SlideShare une entreprise Scribd logo
1  sur  69
Spring vs. Java EE QConSP 2012
Spring vs. Java EE QConSP 2012
LIGHTWEIGHT
WEB APP CHAMPIONSHIP
QCONSP #3
Duelo de titãs



                 SPRING vs
                 JAVA EE
QCONSP #3   JUÍZES
QCONSP #3   THE CHALLENGER
JAVA EE
  PLATFORM
  • lutador experiente
  • mudou a tática no Java EE 5
  • ganhou confiança: CDI
  • perdeu peso para ser ágil
  • quer lutar na nuvem
    Patrocinado por: Oracle, Red Hat, IBM and
                      other


QCONSP #3                         THE CHALLENGER
QCONSP #3   THE CHAMPION
THE SPRING
  FRAMEWORK
  • sem derrota desde 2004
  • nocauteou o J2EE
  • luta em qualquer container
  • golpes fortes com POJOs
  • sabe explorar bem seu oponente
  Patrocinado por: Spring Source



QCONSP #3                            THE CHAMPION
QCONSP #3   FIGHT CARD
“Spring always depended on Java EE.”
                Bill Burke




QCONSP #3                    FIGHT CARD
Princípio UFC
                (princípio hollywood)




       “Don’t fight us, we fight you!”




QCONSP #3                               ROUND #1
CDI




QCONSP #3         ROUND #1
"Spring does, truly, embody many of
        the best practices of 2004."
                 Gavin King




QCONSP #3                         ROUND #1
IoC / DI




QCONSP #3              ROUND #1
IoC / DI
           Spring                              JavaEE
@Controller                       @Named
@Scope(“request”)                 @RequestScoped
public class ContatoBean {        public class ContatoBean {

  @Autowired //@Inject              @Inject
  private ContatoDAO dao;           private ContatoDAO dao;




QCONSP #3                                        ROUND #1
Persistência




QCONSP #3                  ROUND #2
Persistência
            Spring                              JavaEE
@Repository                        @Stateless
public class ContatoDAO {          public class ContatoDAO {

  @PersistenceContext                 @PersistenceContext
  private EntityManager manager;      private EntityManager manager;



                          persistence.xml
                        definição datasource




QCONSP #3                                         ROUND #2
Persistência




QCONSP #3                  ROUND #2
Persistência
@Repository
               Spring                 @Stateless
                                                      JavaEE
public class ContatoDAO {             public class ContatoDAO {

    @Autowired                          @Resource
    private JdbcTemplate template;      private DataSource ds;

                                        public void salva(Contato c){
    public void salva(Contato c) {        try {
      template.update(                     Connection con = ds.getConn..();
        "insert ... values (?, ?)",        PreparedStatement ps =
        c.nome(), c.idade());            con.prepareStatement(“insert ..”);
    }                                      ps.setString(1, c.nome());
}                                          ps.setString(1, c.idade());
                                           ps.execute();
                                           ps.close();
                                          }catch(..){} ...




QCONSP #3                                               ROUND #2
Persistência




QCONSP #3                  ROUND #2
Persistência


             Spring Data




QCONSP #3                  ROUND #2
Transação e Exceção




QCONSP #3               ROUND #3
Transação e Exceção
            Spring                               JavaEE
@Transactional(...)                @TransactionAttribute(...)
@Repository                        @Stateless
public class ContatoDAO {          public class ContatoDAO {

  @PersistenceContext                @PersistenceContext
  private EntityManager manager;     private EntityManager manager;



<bean id=”xxxTransactionManager”   ejb-jar.xml
 .../>




QCONSP #3                                         ROUND #3
Transação e Exceção




QCONSP #3               ROUND #3
Transação e Exceção
             Spring                                   JavaEE
@Transaction(rollbackFor=              @ApplicationException(rollback=true)
                 DaoException.class)   public class DaoException
public class ContatoController{                        extends Exception{}




•HandlerExceptionResolver              •<error-page>
•AOP Proxies                           •filtros ou interceptadores




QCONSP #3                                               ROUND #3
QCONSP #3   ROUND #4
Web-Peso leve




QCONSP #3                   ROUND #4
Web-Peso leve
@Controller
                    Spring                        @Named
                                                                      JavaEE
@Transactional                                    @RequestScoped
public class ContatoController {                  public class ContatoMB {

    @Autowired                                      private Contato contato;
    private ContatoDAO dao;                         private List<Contato> contatos;

    @RequestMapping("/adicionar")                   @Inject
    public ModelAndView adicionar(Contato c){       private ContatoDAO dao;
      dao.salva(c);
      ModelAndView mv = new ModelAndView("ok");     public void salvar(){
      mv.addObject("contatos", dao.lista);              dao.salva(contato);
      return mav;                                       zeraForm();
}                                                   }




QCONSP #3                                                               ROUND #4
Web-Peso pesado




QCONSP #3                 ROUND #4
Web-Peso pesado
                 Spring                                              JavaEE
public class EncodingPostProcessor             public class UtilMB {
        implements BeanPostProcessor {
                                                   public String reset() {
public Object postProcessBeforeInitialzation         FacesContext context =
          (Object bean, String name)                      FacesContext.getCurrentInstance();
                    throws BeansException            Application application =
{if(bean instanceof                                       context.getApplication();
       AnnotationMethodHandlerAdapter) {             ViewHandler viewHandler =
                                                          application.getViewHandler();
HttpMessageConverter<?>[] convs =                    UIViewRoot viewRoot =
((AnnotationMethodHandlerAdapter)                         viewHandler.createView(context,
bean).getMessageConverters();                             context.getViewRoot().getViewId());
                                                     context.setViewRoot(viewRoot);
for (HttpMessageConverter<?> conv : convs) {         return "success";
                                                   }
   if(conv instanceof                          }
           StringHttpMessageConverter) {

((StringHttpMessageConverter) conv)
.setSupportedMediaTypes(Arrays
.asList(new MediaType("text", "
Charset.forName("UTF-)
}



QCONSP #3                                                              ROUND #4
Web


    Action-based vs. Component-based




QCONSP #3                      ROUND #4
Web-Service - SOAP




QCONSP #3               ROUND #5
Web-Service - SOAP
               Spring                                                JavaEE
@WebService                                    @WebService
public class ContatosWS extends                public class ContatosWS{
               SpringBeanAutowiringSupport{
                                                   @Inject
   @Autowired                                      ContatoDAO dao;
   private ContatoDAO dao;
                                                   public List<Contato> listaDeContatos(){
   public List<Contato> listaDeContatos() {           return dao.lista();
     if(dao==null{                                 }
processInjectionBasedOnCurrentContext(this);
     }                                         }
      ...;
   }
}




QCONSP #3                                                             ROUND #5
Web-Service - REST




QCONSP #3               ROUND #5
Web-Service - REST
@Controller
                 Spring                           @Path("/")
                                                                     JavaEE
public class ContatoResource {                    public class ContatoResource {

    @Autowired                                        @Inject
    private ContatoDAO dao;                           private ContatoDAO dao;

    @RequestMapping(                                  @GET
      value = "/contatos/{id}",                       @Path("/contatos/{id}")
      produces={"application/json"},                  @Produces({"application/json"})
       method=RequestMethod.GET)                      public Contato load(@PathParam("id")
    @ResponseBody                                                                    Long id){
    public Contato load(@PathVariable("id")              return dao.busca(id);
                                     Long id) {       }
         return dao.busca(id);                    }
    }
}




QCONSP #3                                                              ROUND #5
Mensageria




QCONSP #3                ROUND #6
Mensageria
                       JavaEE - JMS
 InitialContext ic = new InitialContext();
 ConnectionFactory cf = (ConnectionFactory)ic.lookup("Factory");
 Connection con = cf.createConnection(..);

 Session session = con.createSession(false,AUTO_ACKNOWLEDGE);
 TextMessage msg = session.createTextMessage("oi jms");
 Queue queue = (Queue)ic.lookup("jms/queue/loja");
 QueueSender sender = session.createSender(queue);

 sender.send(textMessage);

 con.close();




QCONSP #3                                       ROUND #6
Mensageria
                       JavaEE - JMS
 InitialContext ic = new InitialContext();
 ConnectionFactory cf = (ConnectionFactory)ic.lookup("Factory");
 Connection con = cf.createConnection(..);

 Session session = con.createSession(false,AUTO_ACKNOWLEDGE);
 TextMessage msg = session.createTextMessage("oi jms");
 Queue queue = (Queue)ic.lookup("jms/queue/loja");
 QueueSender sender = session.createSender(queue);

 sender.send(textMessage);

 con.close();




QCONSP #3                                       ROUND #6
Mensageria
                   Spring - JMSTemplate
 @Autowired JmsTemplate template;
 @Autowired Queue queue;

 public void enviaMensagem() {
    this.template.send(queue, new MessageCreator() {
        public Message createMessage(Session s) throws JMSException {
               return session.createTextMessage("oi jms");
        }
    });
 }




QCONSP #3                                            ROUND #6
Mensageria
                   Spring - JMSTemplate
 @Autowired JmsTemplate template;
 @Autowired Queue queue;

 public void enviaMensagem() {
    this.template.send(queue, new MessageCreator() {
        public Message createMessage(Session s) throws JMSException {
               return session.createTextMessage("oi jms");
        }
    });
 }




QCONSP #3                                            ROUND #6
Mensageria




QCONSP #3                ROUND #6
Mensageria


            Spring Integration




QCONSP #3                        ROUND #6
Segurança




QCONSP #3               ROUND #7
Segurança
                                    JavaEE - JAAS
<security-constraint>                          @RolesAllowed({"cliente"})
 <web-resource-collection>                     public void salva(Contato contato){
    <url-pattern>/adiciona.jsf</url-pattern>     //...
 </web-resource-collection>                    }
 <auth-constraint>
    <role-name>*</role-name>                   @PermitAll, @DenyAll ...
 </auth-constraint>
</security-constraint>

<login-config>
 <auth-method>FORM</auth-method>v
   <form-login-config>
    <form-login-page>/login.jsf
   </form-login-page>
  </form-login-config>
</login-config>

<security-role>
 <role-name>*</role-name>
</security-role>




QCONSP #3                                                           ROUND #7
Segurança
                                    JavaEE - JAAS
<security-constraint>                          @RolesAllowed({"cliente"})
 <web-resource-collection>                     public void salva(Contato contato){
    <url-pattern>/adiciona.jsf</url-pattern>     //...
 </web-resource-collection>                    }
 <auth-constraint>
    <role-name>*</role-name>                   @PermitAll, @DenyAll ...
 </auth-constraint>
</security-constraint>

<login-config>
 <auth-method>FORM</auth-method>v
   <form-login-config>
    <form-login-page>/login.jsf
   </form-login-page>
  </form-login-config>
</login-config>

<security-role>
 <role-name>*</role-name>
</security-role>




QCONSP #3                                                           ROUND #7
Segurança




QCONSP #3               ROUND #7
Segurança
                                Spring Security
<sec:authentication-manager>                   @Secured({"cliente"})
   <sec:authentication-provider                public void salva(Contato contato){
       user-service-ref="userDAO" />             //...
   </sec:authentication-manager>               }

<sec:http auto-config="true">
  <sec:intercept-url                           <sec:authorize access="hasRole('cliente')">
       pattern="/contatos.spring"                 um jsp restrito
       access="ROLE_USER" />                   </sec:authorize>

  <sec:form-login
    login-page="/login-form.spring"
    default-target-url="/contatos.spring"
    login-processing-url="/login" />

  <sec:logout logout-url="/logout"
   logout-success-url="/login-form.spring"/>

</sec:http>




QCONSP #3                                                           ROUND #7
Infra-Spring




QCONSP #3                  ROUND #8
Infra-Spring




QCONSP #3                  ROUND #8
QCONSP #3   ROUND #8
Infra-JavaEE




QCONSP #3                  ROUND #8
Infra-JavaEE




QCONSP #3                  ROUND #8
Infra-Cloud




QCONSP #3                 ROUND #8
Extras

      “We will create new projects
     where no good solution exists.”
             SpringSource




QCONSP #3                      ROUND #9
Extras




QCONSP #3            ROUND #9
Extras




QCONSP #3            ROUND #9
Extras




QCONSP #3            ROUND #9
Especifição
                  vs
            Implementação




QCONSP #3               ROUND #10
Especifição
                  vs
            Implementação




QCONSP #3               ROUND #10
Especifição
                  vs
            Implementação




QCONSP #3               ROUND #10
Especifição
                  vs
            Implementação

     “Standards are for standardizing,
           and not innovating.”
            Ed Burns (Líder JSF-Spec )




QCONSP #3                                ROUND #10
Especifição
                  vs
            Implementação




QCONSP #3               ROUND #10
Especifição
                  vs
            Implementação

    "Stick to the standard when you can,
    leave the standards when you need."
      Antonio Goncalves (JCP Expert Member)




QCONSP #3                            ROUND #10
QCONSP #3   SCORE
QCONSP #3   SCORE
QCONSP #3   SCORE
QCONSP #3   OBRIGADO!
PERGUNTAS?

QCONSP #3       OBRIGADO!

Contenu connexe

Tendances

Sustaining Test-Driven Development
Sustaining Test-Driven DevelopmentSustaining Test-Driven Development
Sustaining Test-Driven DevelopmentAgileOnTheBeach
 
Vaadin 7 Today and Tomorrow
Vaadin 7 Today and TomorrowVaadin 7 Today and Tomorrow
Vaadin 7 Today and TomorrowJoonas Lehtinen
 
React, Redux and es6/7
React, Redux and es6/7React, Redux and es6/7
React, Redux and es6/7Dongho Cho
 
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 WinterHuahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 WinterRyu Kobayashi
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능knight1128
 
クラウド・アプリケーション・アーキテクチャ
クラウド・アプリケーション・アーキテクチャクラウド・アプリケーション・アーキテクチャ
クラウド・アプリケーション・アーキテクチャTomoharu ASAMI
 
Actionsscript cheat sheet_letter
Actionsscript cheat sheet_letterActionsscript cheat sheet_letter
Actionsscript cheat sheet_letterRadik Setagalih
 
Actionsscript Cheat Sheet Letter
Actionsscript Cheat Sheet LetterActionsscript Cheat Sheet Letter
Actionsscript Cheat Sheet Letterguest2a6b08
 
Vaadin today and tomorrow
Vaadin today and tomorrowVaadin today and tomorrow
Vaadin today and tomorrowJoonas Lehtinen
 
Petcube epic battle: architecture vs product. UA Mobile 2017.
Petcube epic battle: architecture vs product. UA Mobile 2017.Petcube epic battle: architecture vs product. UA Mobile 2017.
Petcube epic battle: architecture vs product. UA Mobile 2017.UA Mobile
 
Highlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
Highlights from Java 10, 11 and 12 and Future of Java at JUG KoblenzHighlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
Highlights from Java 10, 11 and 12 and Future of Java at JUG KoblenzVadym Kazulkin
 
Spring Framework Petclinic sample application
Spring Framework Petclinic sample applicationSpring Framework Petclinic sample application
Spring Framework Petclinic sample applicationAntoine Rey
 
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013Raimundas Banevičius
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...PROIDEA
 
WebGL - 3D in your Browser
WebGL - 3D in your BrowserWebGL - 3D in your Browser
WebGL - 3D in your BrowserPhil Reither
 
Testing Your JavaScript & CoffeeScript
Testing Your JavaScript & CoffeeScriptTesting Your JavaScript & CoffeeScript
Testing Your JavaScript & CoffeeScriptMark
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoinknight1128
 

Tendances (19)

Sustaining Test-Driven Development
Sustaining Test-Driven DevelopmentSustaining Test-Driven Development
Sustaining Test-Driven Development
 
Vaadin 7 Today and Tomorrow
Vaadin 7 Today and TomorrowVaadin 7 Today and Tomorrow
Vaadin 7 Today and Tomorrow
 
React, Redux and es6/7
React, Redux and es6/7React, Redux and es6/7
React, Redux and es6/7
 
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 WinterHuahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
 
クラウド・アプリケーション・アーキテクチャ
クラウド・アプリケーション・アーキテクチャクラウド・アプリケーション・アーキテクチャ
クラウド・アプリケーション・アーキテクチャ
 
Actionsscript cheat sheet_letter
Actionsscript cheat sheet_letterActionsscript cheat sheet_letter
Actionsscript cheat sheet_letter
 
Actionsscript Cheat Sheet Letter
Actionsscript Cheat Sheet LetterActionsscript Cheat Sheet Letter
Actionsscript Cheat Sheet Letter
 
Vaadin today and tomorrow
Vaadin today and tomorrowVaadin today and tomorrow
Vaadin today and tomorrow
 
Petcube epic battle: architecture vs product. UA Mobile 2017.
Petcube epic battle: architecture vs product. UA Mobile 2017.Petcube epic battle: architecture vs product. UA Mobile 2017.
Petcube epic battle: architecture vs product. UA Mobile 2017.
 
Highlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
Highlights from Java 10, 11 and 12 and Future of Java at JUG KoblenzHighlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
Highlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
 
Spring Framework Petclinic sample application
Spring Framework Petclinic sample applicationSpring Framework Petclinic sample application
Spring Framework Petclinic sample application
 
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
 
Mvc express presentation
Mvc express presentationMvc express presentation
Mvc express presentation
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
 
WebGL - 3D in your Browser
WebGL - 3D in your BrowserWebGL - 3D in your Browser
WebGL - 3D in your Browser
 
mvcExpress training course : part1
mvcExpress training course : part1mvcExpress training course : part1
mvcExpress training course : part1
 
Testing Your JavaScript & CoffeeScript
Testing Your JavaScript & CoffeeScriptTesting Your JavaScript & CoffeeScript
Testing Your JavaScript & CoffeeScript
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoin
 

En vedette

Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - IntroductionSagar Acharya
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorialClaude Tech
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework Sakthi Bro
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architectureGabriele Falace
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudBen Wilcock
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)Gary Arora
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS ArchitectureEyal Vardi
 

En vedette (11)

Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Angular js
Angular jsAngular js
Angular js
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorial
 
Angular JS
Angular JSAngular JS
Angular JS
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architecture
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 

Similaire à Spring vs. Java EE QConSP 2012

比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Supercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicSupercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicIan Robertson
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureAlexey Buzdin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureC.T.Co
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's NewTed Pennings
 
Spring 4 final xtr_presentation
Spring 4 final xtr_presentationSpring 4 final xtr_presentation
Spring 4 final xtr_presentationsourabh aggarwal
 
Modern Android app library stack
Modern Android app library stackModern Android app library stack
Modern Android app library stackTomáš Kypta
 
MVC on the server and on the client
MVC on the server and on the clientMVC on the server and on the client
MVC on the server and on the clientSebastiano Armeli
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaRick Warren
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
Spring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSpring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSam Brannen
 
MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...
MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...
MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...jaxconf
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
Data Types/Structures in DivConq
Data Types/Structures in DivConqData Types/Structures in DivConq
Data Types/Structures in DivConqeTimeline, LLC
 
SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8Ben Abdallah Helmi
 

Similaire à Spring vs. Java EE QConSP 2012 (20)

比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Supercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicSupercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamic
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
 
Get ready for spring 4
Get ready for spring 4Get ready for spring 4
Get ready for spring 4
 
Spring 4 final xtr_presentation
Spring 4 final xtr_presentationSpring 4 final xtr_presentation
Spring 4 final xtr_presentation
 
Java beans
Java beansJava beans
Java beans
 
Modern Android app library stack
Modern Android app library stackModern Android app library stack
Modern Android app library stack
 
MVC on the server and on the client
MVC on the server and on the clientMVC on the server and on the client
MVC on the server and on the client
 
Tdd iPhone For Dummies
Tdd iPhone For DummiesTdd iPhone For Dummies
Tdd iPhone For Dummies
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJava
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
Java
JavaJava
Java
 
Spring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSpring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing Support
 
MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...
MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...
MVC on the Server and on the Client: How to Integrate Spring MVC and Backbone...
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Data Types/Structures in DivConq
Data Types/Structures in DivConqData Types/Structures in DivConq
Data Types/Structures in DivConq
 
SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8
 

Dernier

Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 

Dernier (20)

Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 

Spring vs. Java EE QConSP 2012

  • 4. QCONSP #3 Duelo de titãs SPRING vs JAVA EE
  • 5. QCONSP #3 JUÍZES
  • 6. QCONSP #3 THE CHALLENGER
  • 7. JAVA EE PLATFORM • lutador experiente • mudou a tática no Java EE 5 • ganhou confiança: CDI • perdeu peso para ser ágil • quer lutar na nuvem Patrocinado por: Oracle, Red Hat, IBM and other QCONSP #3 THE CHALLENGER
  • 8. QCONSP #3 THE CHAMPION
  • 9. THE SPRING FRAMEWORK • sem derrota desde 2004 • nocauteou o J2EE • luta em qualquer container • golpes fortes com POJOs • sabe explorar bem seu oponente Patrocinado por: Spring Source QCONSP #3 THE CHAMPION
  • 10. QCONSP #3 FIGHT CARD
  • 11. “Spring always depended on Java EE.” Bill Burke QCONSP #3 FIGHT CARD
  • 12. Princípio UFC (princípio hollywood) “Don’t fight us, we fight you!” QCONSP #3 ROUND #1
  • 13. CDI QCONSP #3 ROUND #1
  • 14. "Spring does, truly, embody many of the best practices of 2004." Gavin King QCONSP #3 ROUND #1
  • 15. IoC / DI QCONSP #3 ROUND #1
  • 16. IoC / DI Spring JavaEE @Controller @Named @Scope(“request”) @RequestScoped public class ContatoBean { public class ContatoBean { @Autowired //@Inject @Inject private ContatoDAO dao; private ContatoDAO dao; QCONSP #3 ROUND #1
  • 18. Persistência Spring JavaEE @Repository @Stateless public class ContatoDAO { public class ContatoDAO { @PersistenceContext @PersistenceContext private EntityManager manager; private EntityManager manager; persistence.xml definição datasource QCONSP #3 ROUND #2
  • 20. Persistência @Repository Spring @Stateless JavaEE public class ContatoDAO { public class ContatoDAO { @Autowired @Resource private JdbcTemplate template; private DataSource ds; public void salva(Contato c){ public void salva(Contato c) { try { template.update( Connection con = ds.getConn..(); "insert ... values (?, ?)", PreparedStatement ps = c.nome(), c.idade()); con.prepareStatement(“insert ..”); } ps.setString(1, c.nome()); } ps.setString(1, c.idade()); ps.execute(); ps.close(); }catch(..){} ... QCONSP #3 ROUND #2
  • 22. Persistência Spring Data QCONSP #3 ROUND #2
  • 24. Transação e Exceção Spring JavaEE @Transactional(...) @TransactionAttribute(...) @Repository @Stateless public class ContatoDAO { public class ContatoDAO { @PersistenceContext @PersistenceContext private EntityManager manager; private EntityManager manager; <bean id=”xxxTransactionManager” ejb-jar.xml .../> QCONSP #3 ROUND #3
  • 26. Transação e Exceção Spring JavaEE @Transaction(rollbackFor= @ApplicationException(rollback=true) DaoException.class) public class DaoException public class ContatoController{ extends Exception{} •HandlerExceptionResolver •<error-page> •AOP Proxies •filtros ou interceptadores QCONSP #3 ROUND #3
  • 27. QCONSP #3 ROUND #4
  • 29. Web-Peso leve @Controller Spring @Named JavaEE @Transactional @RequestScoped public class ContatoController { public class ContatoMB { @Autowired private Contato contato; private ContatoDAO dao; private List<Contato> contatos; @RequestMapping("/adicionar") @Inject public ModelAndView adicionar(Contato c){ private ContatoDAO dao; dao.salva(c); ModelAndView mv = new ModelAndView("ok"); public void salvar(){ mv.addObject("contatos", dao.lista); dao.salva(contato); return mav; zeraForm(); } } QCONSP #3 ROUND #4
  • 31. Web-Peso pesado Spring JavaEE public class EncodingPostProcessor public class UtilMB { implements BeanPostProcessor { public String reset() { public Object postProcessBeforeInitialzation FacesContext context = (Object bean, String name) FacesContext.getCurrentInstance(); throws BeansException Application application = {if(bean instanceof context.getApplication(); AnnotationMethodHandlerAdapter) { ViewHandler viewHandler = application.getViewHandler(); HttpMessageConverter<?>[] convs = UIViewRoot viewRoot = ((AnnotationMethodHandlerAdapter) viewHandler.createView(context, bean).getMessageConverters(); context.getViewRoot().getViewId()); context.setViewRoot(viewRoot); for (HttpMessageConverter<?> conv : convs) { return "success"; } if(conv instanceof } StringHttpMessageConverter) { ((StringHttpMessageConverter) conv) .setSupportedMediaTypes(Arrays .asList(new MediaType("text", " Charset.forName("UTF-) } QCONSP #3 ROUND #4
  • 32. Web Action-based vs. Component-based QCONSP #3 ROUND #4
  • 34. Web-Service - SOAP Spring JavaEE @WebService @WebService public class ContatosWS extends public class ContatosWS{ SpringBeanAutowiringSupport{ @Inject @Autowired ContatoDAO dao; private ContatoDAO dao; public List<Contato> listaDeContatos(){ public List<Contato> listaDeContatos() { return dao.lista(); if(dao==null{ } processInjectionBasedOnCurrentContext(this); } } ...; } } QCONSP #3 ROUND #5
  • 36. Web-Service - REST @Controller Spring @Path("/") JavaEE public class ContatoResource { public class ContatoResource { @Autowired @Inject private ContatoDAO dao; private ContatoDAO dao; @RequestMapping( @GET value = "/contatos/{id}", @Path("/contatos/{id}") produces={"application/json"}, @Produces({"application/json"}) method=RequestMethod.GET) public Contato load(@PathParam("id") @ResponseBody Long id){ public Contato load(@PathVariable("id") return dao.busca(id); Long id) { } return dao.busca(id); } } } QCONSP #3 ROUND #5
  • 38. Mensageria JavaEE - JMS InitialContext ic = new InitialContext(); ConnectionFactory cf = (ConnectionFactory)ic.lookup("Factory"); Connection con = cf.createConnection(..); Session session = con.createSession(false,AUTO_ACKNOWLEDGE); TextMessage msg = session.createTextMessage("oi jms"); Queue queue = (Queue)ic.lookup("jms/queue/loja"); QueueSender sender = session.createSender(queue); sender.send(textMessage); con.close(); QCONSP #3 ROUND #6
  • 39. Mensageria JavaEE - JMS InitialContext ic = new InitialContext(); ConnectionFactory cf = (ConnectionFactory)ic.lookup("Factory"); Connection con = cf.createConnection(..); Session session = con.createSession(false,AUTO_ACKNOWLEDGE); TextMessage msg = session.createTextMessage("oi jms"); Queue queue = (Queue)ic.lookup("jms/queue/loja"); QueueSender sender = session.createSender(queue); sender.send(textMessage); con.close(); QCONSP #3 ROUND #6
  • 40. Mensageria Spring - JMSTemplate @Autowired JmsTemplate template; @Autowired Queue queue; public void enviaMensagem() { this.template.send(queue, new MessageCreator() { public Message createMessage(Session s) throws JMSException { return session.createTextMessage("oi jms"); } }); } QCONSP #3 ROUND #6
  • 41. Mensageria Spring - JMSTemplate @Autowired JmsTemplate template; @Autowired Queue queue; public void enviaMensagem() { this.template.send(queue, new MessageCreator() { public Message createMessage(Session s) throws JMSException { return session.createTextMessage("oi jms"); } }); } QCONSP #3 ROUND #6
  • 43. Mensageria Spring Integration QCONSP #3 ROUND #6
  • 45. Segurança JavaEE - JAAS <security-constraint> @RolesAllowed({"cliente"}) <web-resource-collection> public void salva(Contato contato){ <url-pattern>/adiciona.jsf</url-pattern> //... </web-resource-collection> } <auth-constraint> <role-name>*</role-name> @PermitAll, @DenyAll ... </auth-constraint> </security-constraint> <login-config> <auth-method>FORM</auth-method>v <form-login-config> <form-login-page>/login.jsf </form-login-page> </form-login-config> </login-config> <security-role> <role-name>*</role-name> </security-role> QCONSP #3 ROUND #7
  • 46. Segurança JavaEE - JAAS <security-constraint> @RolesAllowed({"cliente"}) <web-resource-collection> public void salva(Contato contato){ <url-pattern>/adiciona.jsf</url-pattern> //... </web-resource-collection> } <auth-constraint> <role-name>*</role-name> @PermitAll, @DenyAll ... </auth-constraint> </security-constraint> <login-config> <auth-method>FORM</auth-method>v <form-login-config> <form-login-page>/login.jsf </form-login-page> </form-login-config> </login-config> <security-role> <role-name>*</role-name> </security-role> QCONSP #3 ROUND #7
  • 48. Segurança Spring Security <sec:authentication-manager> @Secured({"cliente"}) <sec:authentication-provider public void salva(Contato contato){ user-service-ref="userDAO" /> //... </sec:authentication-manager> } <sec:http auto-config="true"> <sec:intercept-url <sec:authorize access="hasRole('cliente')"> pattern="/contatos.spring" um jsp restrito access="ROLE_USER" /> </sec:authorize> <sec:form-login login-page="/login-form.spring" default-target-url="/contatos.spring" login-processing-url="/login" /> <sec:logout logout-url="/logout" logout-success-url="/login-form.spring"/> </sec:http> QCONSP #3 ROUND #7
  • 51. QCONSP #3 ROUND #8
  • 55. Extras “We will create new projects where no good solution exists.” SpringSource QCONSP #3 ROUND #9
  • 56. Extras QCONSP #3 ROUND #9
  • 57. Extras QCONSP #3 ROUND #9
  • 58. Extras QCONSP #3 ROUND #9
  • 59. Especifição vs Implementação QCONSP #3 ROUND #10
  • 60. Especifição vs Implementação QCONSP #3 ROUND #10
  • 61. Especifição vs Implementação QCONSP #3 ROUND #10
  • 62. Especifição vs Implementação “Standards are for standardizing, and not innovating.” Ed Burns (Líder JSF-Spec ) QCONSP #3 ROUND #10
  • 63. Especifição vs Implementação QCONSP #3 ROUND #10
  • 64. Especifição vs Implementação "Stick to the standard when you can, leave the standards when you need." Antonio Goncalves (JCP Expert Member) QCONSP #3 ROUND #10
  • 65. QCONSP #3 SCORE
  • 66. QCONSP #3 SCORE
  • 67. QCONSP #3 SCORE
  • 68. QCONSP #3 OBRIGADO!
  • 69. PERGUNTAS? QCONSP #3 OBRIGADO!

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n