SlideShare a Scribd company logo
Wicket + JEE 6
       Michael Plöd
  Senacor Technologies AG
Agenda

• Brief Wicket Intro
• Standard Wicket - Spring App
• Integrating Wicket and EJB with CDI
• Integrating Wicket and Bean Validation
• Coding Example
Quickstart
mvn archetype:create
 -DarchetypeGroupId=org.apache.wicket
 -DarchetypeArtifactId=
       wicket-archetype-quickstart
 -DarchetypeVersion=1.4.13
 -DgroupId=com.senacor
 -DartifactId=wicket-example
WebApplication.java




                   wicket
HomePage.java         -               HomePage.html
                  example



                     web.xml
web.xml
   configures
Application
<web-app ... >
  <display-name>wicket-example</display-name>

  <filter>
  <filter-name>wicket.wicket-example</filter-name>
     <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
     <init-param>
       <param-name>applicationClassName</param-name>
        <param-value>com.senacor.WicketApplication</param-value>
     </init-param>
  </filter>

   <filter-mapping>
       <filter-name>wicket.wicket-example</filter-name>
     <url-pattern>/*</url-pattern>
   </filter-mapping>
</web-app>
Application
   is responsible for
bootstrapping
package com.senacor;

import org.apache.wicket.protocol.http.WebApplication;

public class WicketApplication extends WebApplication
{
  public WicketApplication() {}

    public Class<HomePage> getHomePage()
    {
      return HomePage.class;
    }
}
no additional
configuration
WebApplication.java




                   wicket
HomePage.java         -               HomePage.html
                  example



                     web.xml
WebApplication.java




                   wicket
HomePage.java         -               HomePage.html
                  example



                     web.xml
Page
defines the Java part
HTML
defines the markup part
public class HomePage extends WebPage {
  public HomePage(final PageParameters parameters) {
     add(new Label("message",
              "If you see this message wicket is
               properly configured and running"));
  }
}
<html xmlns:wicket=
   "http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" >
  <head>
     <title>Wicket Quickstart Archetype Homepage</title>
  </head>
  <body>
     <strong>Wicket Quickstart Archetype Homepage</strong>
     <br/><br/>
     <span wicket:id="message">message will be here</span>
  </body>
</html>
<span wicket:id="message">message will be here</span>

add(new Label("message",
           "If you see this message wicket is
            properly configured and running"));
Spring                                        JEE



<span wicket:id="message">message will be here</span>

add(new Label("message",
           "If you see this message wicket is
            properly configured and running"));
Typical          Wicket
Wicket - Spring           @SpringBean
 Application
                   <Service>
                  Spring Bean

                          @Autowired


                  <Repository>
                   Spring Bean
public class HomePage extends WebPage {
  @SpringBean
  private PersonService personService;

    private class PersonListModel
      extends LoadableDetachableModel<List<Person>> {
        @Override
        protected List<Person> load() {
            return personService.listPersons();
        }
    }
    public HomePage(final PageParameters parameters) {
        ...
        final PropertyListView<Person> list =
          new PropertyListView<Person>("persons", new PersonListModel()) {
          ...
            }
        };
...
JSF                    Typical Java EE 6
          @ManagedBean +        Application
          @EJB / Inject

 <Service>
  EJB 3.1

          @Inject / @EJB


  <DAO>
EJB 3.1 / JPA
JSF
Wicket
  Wicket
                                     +
                          ?   Java EE6
 <Service>
  EJB 3.1

         @Inject / @EJB


  <DAO>
EJB 3.1 + JPA
Component wiring with CDI
     Weld / Seam Wicket Module
META-INF/beans.xml
or
WEB-INF/beans.xml
package com.senacor;

import org.apache.wicket.protocol.http.WebApplication;

public class WicketApplication extends WeldApplication
{
  public WicketApplication() {}

    public Class<HomePage> getHomePage()
    {
      return HomePage.class;
    }
}
public class HomePage extends WebPage {
  @Inject
  private PersonService personService;

    private class PersonListModel
      extends LoadableDetachableModel<List<Person>> {
        @Override
        protected List<Person> load() {
            return personService.listPersons();
        }
    }
    public HomePage(final PageParameters parameters) {
        ...
        final PropertyListView<Person> list =
          new PropertyListView<Person>("persons", new PersonListModel()) {
          ...
            }
        };
...
„Programming today is a race
between software engineers striving
to build bigger and better idiot-proof
programs, and the universe trying to
build bigger and better idiots.

So far, the universe is winning.“
-- Robert Cringely --
Model
Validation
  with Wicket
Validate                      Validation
                 Conversion
mandatory                          of




       Back to input           Validation
         screen                    of




                 onSubmit       Update
                EventHandler    model
Validate                      Validation
                 Conversion
mandatory                          of




       Back to input           Validation
         screen                    of




                 onSubmit       Update
                EventHandler    model
form.add(new TextField("firstname").setRequired(true));

form.add(new TextField("email")
              .setRequired(true)
              .add(EmailAddressValidator.getInstance()));

form.add(new TextField("age")
              .add(NumberValidator.minimum(18)));

form.add(new TextField("username")
              .add(StringValidator.lengthBetween(6, 10)));

form.add(new TextField("username")
              .add(new PatternValidator("[a-zA-Z0-9]*"))
              .add(StringValidator.lengthBetween(6, 10)));
No support for
           Model
Bean Validation
    Validation
     in Wicket 1.4
       with Wicket
JSR-303 Wicket Validator

from Zenika
http://code.google.com/p/wicket-jsr303-validators/

http://blog.zenika.com/index.php?post/
2010/02/24/Wicket-JSR-303-Validators
public class Person {
  @NotNull private String firstname;
  @NotNull @EMail private String email;
  ...
}
form.setModel(new CompoundPropertyModel(new Person()));
form.add(new TextField("firstname"));
form.add(new TextField("email"));
form.add(new TextField("age"));
form.add(new TextField("password"));
form.add(new TextField("username"));
form.add(new JSR303FormValidator());
Live Coding
      example
https://github.com/mploed/wicketjee6-example
Further Reading
   Wicket In Action
   Martijn Dashorst, Eelco Hillenius
   Manning



   Wicket
   Roland Förther, Olaf Siefart, Carl-Eric Menzel
   dpunkt Verlag
Thank
     You!
     Michael Plöd
Senacor Technologies AG

More Related Content

What's hot

Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 
Getting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseGetting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseVMware Tanzu
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC frameworkMohit Gupta
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depthVinay Kumar
 
jDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownjDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownMert Çalışkan
 
Spring Framework 5.2: Core Container Revisited
Spring Framework 5.2: Core Container RevisitedSpring Framework 5.2: Core Container Revisited
Spring Framework 5.2: Core Container RevisitedVMware Tanzu
 
Declarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleDeclarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleFelix Meschberger
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVCDzmitry Naskou
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)Hendrik Ebbers
 
Different Types of Containers in Spring
Different Types of Containers in Spring Different Types of Containers in Spring
Different Types of Containers in Spring Sunil kumar Mohanty
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
Spring bean mod02
Spring bean mod02Spring bean mod02
Spring bean mod02Guo Albert
 

What's hot (20)

Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Getting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseGetting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA release
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
jDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownjDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring Smackdown
 
Spring Framework 5.2: Core Container Revisited
Spring Framework 5.2: Core Container RevisitedSpring Framework 5.2: Core Container Revisited
Spring Framework 5.2: Core Container Revisited
 
Declarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleDeclarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi style
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
Different Types of Containers in Spring
Different Types of Containers in Spring Different Types of Containers in Spring
Different Types of Containers in Spring
 
Java Concurrent
Java ConcurrentJava Concurrent
Java Concurrent
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Spring bean mod02
Spring bean mod02Spring bean mod02
Spring bean mod02
 
Angular 2
Angular 2Angular 2
Angular 2
 

Viewers also liked

Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)jcompagner
 
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Baruch Sadogursky
 
Apache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just JavaApache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just JavaMartijn Dashorst
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web FrameworkLuther Baker
 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket IntroductionEyal Golan
 

Viewers also liked (6)

Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)
 
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
 
Apache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just JavaApache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just Java
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
 
Wicket 2010
Wicket 2010Wicket 2010
Wicket 2010
 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket Introduction
 

Similar to Integrating Wicket with Java EE 6

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
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejugrobbiev
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoasZeid Hassan
 
Spring Framework Petclinic sample application
Spring Framework Petclinic sample applicationSpring Framework Petclinic sample application
Spring Framework Petclinic sample applicationAntoine Rey
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauSpiffy
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVCRichard Paul
 
I really need help on this question.Create a program that allows t.pdf
I really need help on this question.Create a program that allows t.pdfI really need help on this question.Create a program that allows t.pdf
I really need help on this question.Create a program that allows t.pdfamitbagga0808
 
Spring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topicsSpring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topicsGuy Nir
 
AnkaraJUG Kasım 2012 - PrimeFaces
AnkaraJUG Kasım 2012 - PrimeFacesAnkaraJUG Kasım 2012 - PrimeFaces
AnkaraJUG Kasım 2012 - PrimeFacesAnkara JUG
 
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4Rob Tweed
 
Introduction to Everit Component Registry - B Zsoldos
Introduction to Everit Component Registry - B ZsoldosIntroduction to Everit Component Registry - B Zsoldos
Introduction to Everit Component Registry - B Zsoldosmfrancis
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsSami Ekblad
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09Daniel Bryant
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJini Lee
 

Similar to Integrating Wicket with Java EE 6 (20)

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
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejug
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
 
Spring Framework Petclinic sample application
Spring Framework Petclinic sample applicationSpring Framework Petclinic sample application
Spring Framework Petclinic sample application
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
 
I really need help on this question.Create a program that allows t.pdf
I really need help on this question.Create a program that allows t.pdfI really need help on this question.Create a program that allows t.pdf
I really need help on this question.Create a program that allows t.pdf
 
Jsf
JsfJsf
Jsf
 
Spring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topicsSpring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topics
 
AnkaraJUG Kasım 2012 - PrimeFaces
AnkaraJUG Kasım 2012 - PrimeFacesAnkaraJUG Kasım 2012 - PrimeFaces
AnkaraJUG Kasım 2012 - PrimeFaces
 
Wicket 6
Wicket 6Wicket 6
Wicket 6
 
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
 
Servlets
ServletsServlets
Servlets
 
Introduction to Everit Component Registry - B Zsoldos
Introduction to Everit Component Registry - B ZsoldosIntroduction to Everit Component Registry - B Zsoldos
Introduction to Everit Component Registry - B Zsoldos
 
Servlet 3.0
Servlet 3.0Servlet 3.0
Servlet 3.0
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-ons
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
 

More from Michael Plöd

Event Sourcing: Einführung und Best Practices
Event Sourcing: Einführung und Best PracticesEvent Sourcing: Einführung und Best Practices
Event Sourcing: Einführung und Best PracticesMichael Plöd
 
Building Microservices with Event Sourcing and CQRS
Building Microservices with Event Sourcing and CQRSBuilding Microservices with Event Sourcing and CQRS
Building Microservices with Event Sourcing and CQRSMichael Plöd
 
Migrating from Grails 2 to Grails 3
Migrating from Grails 2 to Grails 3Migrating from Grails 2 to Grails 3
Migrating from Grails 2 to Grails 3Michael Plöd
 
Event Sourcing: Introduction & Challenges
Event Sourcing: Introduction & ChallengesEvent Sourcing: Introduction & Challenges
Event Sourcing: Introduction & ChallengesMichael Plöd
 
Caching in Hibernate
Caching in HibernateCaching in Hibernate
Caching in HibernateMichael Plöd
 
Anatomie von Microservice Landschaften
Anatomie von Microservice LandschaftenAnatomie von Microservice Landschaften
Anatomie von Microservice LandschaftenMichael Plöd
 
Event Sourcing für reaktive Anwendungen
Event Sourcing für reaktive AnwendungenEvent Sourcing für reaktive Anwendungen
Event Sourcing für reaktive AnwendungenMichael Plöd
 
CQRS basierte Architekturen mit Microservices
CQRS basierte Architekturen mit MicroservicesCQRS basierte Architekturen mit Microservices
CQRS basierte Architekturen mit MicroservicesMichael Plöd
 
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICESSpring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICESMichael Plöd
 
Caching - Hintergründe, Patterns und Best Practices
Caching - Hintergründe, Patterns und Best PracticesCaching - Hintergründe, Patterns und Best Practices
Caching - Hintergründe, Patterns und Best PracticesMichael Plöd
 
Warum empfehle ich meinen Kunden das Spring Framework?
Warum empfehle ich meinen Kunden das Spring Framework? Warum empfehle ich meinen Kunden das Spring Framework?
Warum empfehle ich meinen Kunden das Spring Framework? Michael Plöd
 
Bessere Präsentationen
Bessere PräsentationenBessere Präsentationen
Bessere PräsentationenMichael Plöd
 

More from Michael Plöd (13)

Event Sourcing: Einführung und Best Practices
Event Sourcing: Einführung und Best PracticesEvent Sourcing: Einführung und Best Practices
Event Sourcing: Einführung und Best Practices
 
Building Microservices with Event Sourcing and CQRS
Building Microservices with Event Sourcing and CQRSBuilding Microservices with Event Sourcing and CQRS
Building Microservices with Event Sourcing and CQRS
 
Migrating from Grails 2 to Grails 3
Migrating from Grails 2 to Grails 3Migrating from Grails 2 to Grails 3
Migrating from Grails 2 to Grails 3
 
Event Sourcing: Introduction & Challenges
Event Sourcing: Introduction & ChallengesEvent Sourcing: Introduction & Challenges
Event Sourcing: Introduction & Challenges
 
Caching in Hibernate
Caching in HibernateCaching in Hibernate
Caching in Hibernate
 
Anatomie von Microservice Landschaften
Anatomie von Microservice LandschaftenAnatomie von Microservice Landschaften
Anatomie von Microservice Landschaften
 
Event Sourcing für reaktive Anwendungen
Event Sourcing für reaktive AnwendungenEvent Sourcing für reaktive Anwendungen
Event Sourcing für reaktive Anwendungen
 
CQRS basierte Architekturen mit Microservices
CQRS basierte Architekturen mit MicroservicesCQRS basierte Architekturen mit Microservices
CQRS basierte Architekturen mit Microservices
 
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICESSpring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
 
Caching - Hintergründe, Patterns und Best Practices
Caching - Hintergründe, Patterns und Best PracticesCaching - Hintergründe, Patterns und Best Practices
Caching - Hintergründe, Patterns und Best Practices
 
Warum empfehle ich meinen Kunden das Spring Framework?
Warum empfehle ich meinen Kunden das Spring Framework? Warum empfehle ich meinen Kunden das Spring Framework?
Warum empfehle ich meinen Kunden das Spring Framework?
 
Hibernate Tuning
Hibernate TuningHibernate Tuning
Hibernate Tuning
 
Bessere Präsentationen
Bessere PräsentationenBessere Präsentationen
Bessere Präsentationen
 

Recently uploaded

Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 

Recently uploaded (20)

Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 

Integrating Wicket with Java EE 6

  • 1. Wicket + JEE 6 Michael Plöd Senacor Technologies AG
  • 2. Agenda • Brief Wicket Intro • Standard Wicket - Spring App • Integrating Wicket and EJB with CDI • Integrating Wicket and Bean Validation • Coding Example
  • 3. Quickstart mvn archetype:create -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId= wicket-archetype-quickstart -DarchetypeVersion=1.4.13 -DgroupId=com.senacor -DartifactId=wicket-example
  • 4. WebApplication.java wicket HomePage.java - HomePage.html example web.xml
  • 5. web.xml configures Application
  • 6. <web-app ... > <display-name>wicket-example</display-name> <filter> <filter-name>wicket.wicket-example</filter-name> <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class> <init-param> <param-name>applicationClassName</param-name> <param-value>com.senacor.WicketApplication</param-value> </init-param> </filter> <filter-mapping> <filter-name>wicket.wicket-example</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
  • 7. Application is responsible for bootstrapping
  • 8. package com.senacor; import org.apache.wicket.protocol.http.WebApplication; public class WicketApplication extends WebApplication { public WicketApplication() {} public Class<HomePage> getHomePage() { return HomePage.class; } }
  • 10. WebApplication.java wicket HomePage.java - HomePage.html example web.xml
  • 11. WebApplication.java wicket HomePage.java - HomePage.html example web.xml
  • 14. public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { add(new Label("message", "If you see this message wicket is properly configured and running")); } } <html xmlns:wicket= "http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <head> <title>Wicket Quickstart Archetype Homepage</title> </head> <body> <strong>Wicket Quickstart Archetype Homepage</strong> <br/><br/> <span wicket:id="message">message will be here</span> </body> </html>
  • 15. <span wicket:id="message">message will be here</span> add(new Label("message", "If you see this message wicket is properly configured and running"));
  • 16. Spring JEE <span wicket:id="message">message will be here</span> add(new Label("message", "If you see this message wicket is properly configured and running"));
  • 17. Typical Wicket Wicket - Spring @SpringBean Application <Service> Spring Bean @Autowired <Repository> Spring Bean
  • 18. public class HomePage extends WebPage { @SpringBean private PersonService personService; private class PersonListModel extends LoadableDetachableModel<List<Person>> {         @Override         protected List<Person> load() {             return personService.listPersons();         }     } public HomePage(final PageParameters parameters) { ... final PropertyListView<Person> list = new PropertyListView<Person>("persons", new PersonListModel()) {           ...             }         }; ...
  • 19. JSF Typical Java EE 6 @ManagedBean + Application @EJB / Inject <Service> EJB 3.1 @Inject / @EJB <DAO> EJB 3.1 / JPA
  • 20. JSF
  • 21. Wicket Wicket + ? Java EE6 <Service> EJB 3.1 @Inject / @EJB <DAO> EJB 3.1 + JPA
  • 22. Component wiring with CDI Weld / Seam Wicket Module
  • 24. package com.senacor; import org.apache.wicket.protocol.http.WebApplication; public class WicketApplication extends WeldApplication { public WicketApplication() {} public Class<HomePage> getHomePage() { return HomePage.class; } }
  • 25. public class HomePage extends WebPage { @Inject private PersonService personService; private class PersonListModel extends LoadableDetachableModel<List<Person>> {         @Override         protected List<Person> load() {             return personService.listPersons();         }     } public HomePage(final PageParameters parameters) { ... final PropertyListView<Person> list = new PropertyListView<Person>("persons", new PersonListModel()) {           ...             }         }; ...
  • 26. „Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning.“ -- Robert Cringely --
  • 28. Validate Validation Conversion mandatory of Back to input Validation screen of onSubmit Update EventHandler model
  • 29. Validate Validation Conversion mandatory of Back to input Validation screen of onSubmit Update EventHandler model
  • 30. form.add(new TextField("firstname").setRequired(true)); form.add(new TextField("email") .setRequired(true) .add(EmailAddressValidator.getInstance())); form.add(new TextField("age") .add(NumberValidator.minimum(18))); form.add(new TextField("username") .add(StringValidator.lengthBetween(6, 10))); form.add(new TextField("username") .add(new PatternValidator("[a-zA-Z0-9]*")) .add(StringValidator.lengthBetween(6, 10)));
  • 31. No support for Model Bean Validation Validation in Wicket 1.4 with Wicket
  • 32. JSR-303 Wicket Validator from Zenika http://code.google.com/p/wicket-jsr303-validators/ http://blog.zenika.com/index.php?post/ 2010/02/24/Wicket-JSR-303-Validators
  • 33. public class Person { @NotNull private String firstname; @NotNull @EMail private String email; ... } form.setModel(new CompoundPropertyModel(new Person())); form.add(new TextField("firstname")); form.add(new TextField("email")); form.add(new TextField("age")); form.add(new TextField("password")); form.add(new TextField("username")); form.add(new JSR303FormValidator());
  • 34. Live Coding example https://github.com/mploed/wicketjee6-example
  • 35. Further Reading Wicket In Action Martijn Dashorst, Eelco Hillenius Manning Wicket Roland Förther, Olaf Siefart, Carl-Eric Menzel dpunkt Verlag
  • 36. Thank You! Michael Plöd Senacor Technologies AG

Editor's Notes

  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