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

Spring MVC
Spring MVCSpring MVC
Spring MVC
Aaron Schram
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
Guo 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 release
VMware Tanzu
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
Mohit Gupta
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
Hùng Nguyễn Huy
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
Hamid Ghorbani
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
Vinay Kumar
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
Santosh Kumar Kar
 
jDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownjDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring Smackdown
Mert Ç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 Revisited
VMware Tanzu
 
Declarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleDeclarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi style
Felix Meschberger
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
Hendrik Ebbers
 
Spring Boot
Spring BootSpring Boot
Spring Boot
HongSeong Jeon
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
zeeshanhanif
 
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
 
Java Concurrent
Java ConcurrentJava Concurrent
Java Concurrent
NexThoughts Technologies
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
Joshua Long
 
Spring bean mod02
Spring bean mod02Spring bean mod02
Spring bean mod02
Guo Albert
 
Angular 2
Angular 2Angular 2
Angular 2
Pramod Raghav
 

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 2008
Baruch 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 Java
Martijn Dashorst
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
Luther Baker
 
Wicket 2010
Wicket 2010Wicket 2010
Wicket 2010
Martijn Dashorst
 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket Introduction
Eyal 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 Spring
Joshua Long
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
Ted Pennings
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejug
robbiev
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
javatwo2011
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
Zeid Hassan
 
Spring Framework Petclinic sample application
Spring Framework Petclinic sample applicationSpring Framework Petclinic sample application
Spring Framework Petclinic sample application
Antoine Rey
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Spiffy
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
Richard 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.pdf
amitbagga0808
 
Jsf
JsfJsf
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
Guy Nir
 
AnkaraJUG Kasım 2012 - PrimeFaces
AnkaraJUG Kasım 2012 - PrimeFacesAnkaraJUG Kasım 2012 - PrimeFaces
AnkaraJUG Kasım 2012 - PrimeFaces
Ankara JUG
 
Wicket 6
Wicket 6Wicket 6
Wicket 6
codepitbull
 
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
Rob Tweed
 
Servlets
ServletsServlets
Servlets
Geethu Mohan
 
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
mfrancis
 
Servlet 3.0
Servlet 3.0Servlet 3.0
Servlet 3.0
Minh Hoang
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-ons
Sami 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/09
Daniel Bryant
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
Jini 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 Practices
Michael 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 CQRS
Michael 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 3
Michael Plöd
 
Event Sourcing: Introduction & Challenges
Event Sourcing: Introduction & ChallengesEvent Sourcing: Introduction & Challenges
Event Sourcing: Introduction & Challenges
Michael Plöd
 
Caching in Hibernate
Caching in HibernateCaching in Hibernate
Caching in Hibernate
Michael Plöd
 
Anatomie von Microservice Landschaften
Anatomie von Microservice LandschaftenAnatomie von Microservice Landschaften
Anatomie von Microservice Landschaften
Michael Plöd
 
Event Sourcing für reaktive Anwendungen
Event Sourcing für reaktive AnwendungenEvent Sourcing für reaktive Anwendungen
Event Sourcing für reaktive Anwendungen
Michael Plöd
 
CQRS basierte Architekturen mit Microservices
CQRS basierte Architekturen mit MicroservicesCQRS basierte Architekturen mit Microservices
CQRS basierte Architekturen mit Microservices
Michael 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 PRACTICES
Michael 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 Practices
Michael 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äsentationen
Michael 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

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 

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