SlideShare a Scribd company logo
1 of 25
Download to read offline
Apache Wicket
                                Java Web Application Framework




St. Louis - Java User’s Group                                    Luther Baker • September 2009
What is Wicket?

• Web Application Framework

• Component-based Framework

• Wicket 1.4 is Java 1.5+ compliant
Where does Wicket fit?
                                 User




           Presentation Tier (Wicket)


 Shared          Business Tier
 Objects

                Integration Tier
Request / Response

JSP Request / Response


                                        home
                     request             jsp
browser                        server
          response
Model 2 (MVC)

Struts, Spring MVC, Stripes
                                           home
                                            jsp
                      request
browser                         server
           response
                                           home
                                         controller
Advantages of R/R

•   Rendering views is generally quite fast

•   Development can leverage existing tag libraries

•   Recruiting developers may be easier

•   Modern implementations have good support
    for DI and IoC frameworks
Disadvantages of R/R
•   Controller implementations must explicitly
    consider multiple concurrent users and threads

•   Controllers generally work literally in terms of
    HTTP requests and responses

•   Controllers often explicitly manage state

•   Not strictly Object Oriented

•   The programming model is skewed
The Impedance Mismatch
The Programming Model

  •   Programming in Java - do we regularly focus on how
      the JVM manages object instances and variables?

  •   Generally, website development requires an
      understanding of the HTTP protocol.

      IE: manually managing state within and across requests
      forces front end handlers to be protocol specific.
What if ... ?
•   What if we considered a page ... a Page?

•   What if we considered a button ... a Button?

•   And upon clicking a button, handled an onClick event?

•   What if web-development resembled Swing
    or event-driven development?

•   What kind of framework could possibly enable this?!
Enter ... Wicket
•   Component-based framework

•   Instead of creating a controller, servlet or action
    class ... create a Page

•   Place components on said Page and define how
    each component reacts to user input

•   Build the Page in Java to manage HTML page
    elements ... not the other way around
The Component Model
The Underlying Abstraction
   •   Graphic elements are laid out in HTML while their
       actual representation, behavior and implementation
       is defined in Java

   •   A DOM style parent/child approach

   •   An event-driven programming model

   •   You wonder ...
       “How can such an abstraction sit on top of HTTP?”
Web App Config
web.xml
   <web-app>

    <context-param>
      <param-name>configuration</param-name>
      <param-value>development</param-value>
    </context-param>

    <filter>
      <filter-name>WebApplication</filter-name>
        <filter-class>
          org.apache.wicket.protocol.http.WicketFilter
        </filter-class>
        <init-param>
          <param-name>applicationClassName</param-name>
          <param-value>mypackage.HelloWorldApplication</param-value>
        </init-param>
    </filter>

     <filter-mapping>
       <filter-name>WebApplication</filter-name>
       <url-pattern>/*</url-pattern>
     </filter-mapping>

   </web-app>
Wicket Config
WicketApplication.java
package mypackage;

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

public class HelloWorldApplication extends WebApplication
{
    public Class getHomePage()
    {
        return HelloWorld.class;
    }
}
General Structure
Markup (HTML’s Role)
 •   Layout the element hierarchy

 •   Style the elements

Code (Java’s Role)
 •   Mirror and implement markup’s element hierarchy

 •   Event handling
Properties Files (~Auxiliary Roles)
 •   Literal strings and i18n
Hello World
Markup
  <html>
    <body>
      <span wicket:id="message">Message goes here!</span>
    </body>
  </html>


Java
  import org.apache.wicket.markup.html.WebPage;
  import org.apache.wicket.markup.html.basic.Label;

  public class HelloWorld extends WebPage
  {
    public HelloWorld()
    {
      add(new Label("message", "Hello World!"));
    }
  }
Forms (HTML)
Markup

<html>
  <body>
    <span wicket:id="message">Message goes here</span>
    <form wicket:id="messageInputForm">
       <input type="text" wicket:id="messageInput"/>
       <input type="submit" value="update"/>
    </form>
  </body>
</html>
Forms (Java)
Java
 public class HelloWorld extends WebPage
 {
   public HelloWorld()
   {
     IModel messageModel = new Model("Hello World!");
     add(new Label("message", messageModel));
     add(new MessageForm("messageInputForm", messageModel));
   }

     private final class MessageForm extends Form
     {
       public MessageForm(String id, IModel model)
       {
         super(id);
         add(new TextField("messageInput", model));
       }

         protected void onSubmit()
         {
           // nothing to do here as the model is automatically updated
         }
     }
 }
Component Family
                    Component                              Page
WebComponent                             Link
                           Panel
WebPage
                                                AjaxLink
               Button

 Checkbox                              TextArea
                            Form
            TextField
                                                DropDown
   Label
                        ...many more
Super Models
•   Static Model

•   Dynamic Model

•   Property Model

•   Compound Property

•   Loadable Detached
Basic Models
Static Model
   public class HelloWorld extends WicketExamplePage
   {
       public HelloWorld()
       {
            add(new Label ("name", new Model(person.getName())));
       }
   }



Dynamic Model
   personForm.add(new RequiredTextField("personName", new IModel<String>()
   {
       @Override
       public String getObject() {
            return person.getName();
       }

          @Override
          public void setObject(String value) {
              person.setName(value);
          }
   }));
More Models
Property Model
   public PropertyModel(final Object modelObject, final String expression)




   class Person                            class Address
   {                                       {
     private Address address;                private String zip;

       public Address getAddress()             public String getZip()
       {                                       {
         return name;                            return zip;
       }                                       }
       ...                                     ...
   }                                       }



   personForm.add(new RequiredTextField("zip",
                  new PropertyModel<Person>(person, "address.zip")));
Demonstration
WebPage Component
 • Java                   • HTML
   Subclass Master Page     child & parent tags

Custom Component
 • Java, HTML             • Child components
 • Panel Superclass       • Tags to include
Event Handling
 • Original HTML          • Ajax (Debug)
 • Generated Javascript   • Submit handling
Ideally Suited For ...
•   Highly interactive apps

•   Help-Desk style ticketing applications and online
    Registration applications

•   Apps with lots of Forms and/or UI controls

•   Apps requiring seamless Ajax behavior

•   Apps simulating thick clients

•   Anytime an event programming model better
    suites the problem domain
Deeper Dive
Maven Quickstart Archetype
 •   An easy way to start with a simple, Mavenized,
     Wicket project

Other Topics
 •   More on Models, Sessions and Security

 •   Unit Testing

 •   Custom components

 •   URL mapping, IoC Integration, Persistence ...
Wicket Resources
Wicket Links
     •   http://wicket.apache.org/

     •   http://wicketstuff.org/

     •   http://cwiki.apache.org/WICKET/


Wicket Books
     •   Wicket in Action (Manning)

     •   Pro Wicket (Apress)

More Related Content

What's hot

Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate FrameworkMohit Kanwar
 
Project Reactor Now and Tomorrow
Project Reactor Now and TomorrowProject Reactor Now and Tomorrow
Project Reactor Now and TomorrowVMware Tanzu
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by DockerTerry Chen
 
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesSpring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesVMware Tanzu
 
Android+init+process
Android+init+processAndroid+init+process
Android+init+processHong Jae Kwon
 
Oracle sharding : Installation & Configuration
Oracle sharding : Installation & ConfigurationOracle sharding : Installation & Configuration
Oracle sharding : Installation & Configurationsuresh gandhi
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningMichel Schildmeijer
 
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Andrejs Prokopjevs
 
SSO With APEX and ADFS the weblogic way
SSO With APEX and ADFS the weblogic waySSO With APEX and ADFS the weblogic way
SSO With APEX and ADFS the weblogic waymakker_nl
 
Oracle data pump
Oracle data pumpOracle data pump
Oracle data pumpmarcxav72
 
introduction about REST API
introduction about REST APIintroduction about REST API
introduction about REST APIAmilaSilva13
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepGuo Albert
 
Presentation Oracle Undo & Redo Structures
Presentation Oracle Undo & Redo StructuresPresentation Oracle Undo & Redo Structures
Presentation Oracle Undo & Redo StructuresJohn Boyle
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dbaOsama Mustafa
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java SlidesVinit Vyas
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS MeetupLINAGORA
 

What's hot (20)

Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Project Reactor Now and Tomorrow
Project Reactor Now and TomorrowProject Reactor Now and Tomorrow
Project Reactor Now and Tomorrow
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
Spring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutesSpring Data JPA from 0-100 in 60 minutes
Spring Data JPA from 0-100 in 60 minutes
 
Angular 2 observables
Angular 2 observablesAngular 2 observables
Angular 2 observables
 
Android+init+process
Android+init+processAndroid+init+process
Android+init+process
 
Oracle sharding : Installation & Configuration
Oracle sharding : Installation & ConfigurationOracle sharding : Installation & Configuration
Oracle sharding : Installation & Configuration
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
 
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
 
SSO With APEX and ADFS the weblogic way
SSO With APEX and ADFS the weblogic waySSO With APEX and ADFS the weblogic way
SSO With APEX and ADFS the weblogic way
 
Oracle data pump
Oracle data pumpOracle data pump
Oracle data pump
 
introduction about REST API
introduction about REST APIintroduction about REST API
introduction about REST API
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
Presentation Oracle Undo & Redo Structures
Presentation Oracle Undo & Redo StructuresPresentation Oracle Undo & Redo Structures
Presentation Oracle Undo & Redo Structures
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dba
 
Lecture: MetaLinks
Lecture: MetaLinksLecture: MetaLinks
Lecture: MetaLinks
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS Meetup
 
Go, meet Lua
Go, meet LuaGo, meet Lua
Go, meet Lua
 

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
 
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
 
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
 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Michael Plöd
 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket IntroductionEyal Golan
 
Importance of computers in military (2)
Importance of computers in military (2)Importance of computers in military (2)
Importance of computers in military (2)CheletteDanica1300511
 
Nursing technology informatics presentation
Nursing technology informatics presentationNursing technology informatics presentation
Nursing technology informatics presentationLeeann Sills
 

Viewers also liked (11)

Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)Wicket Next (1.4/1.5)
Wicket Next (1.4/1.5)
 
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
 
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
 
Wicket 2010
Wicket 2010Wicket 2010
Wicket 2010
 
What is sap
What is sapWhat is sap
What is sap
 
Adv and disadv of technology
Adv and disadv of technologyAdv and disadv of technology
Adv and disadv of technology
 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6
 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket Introduction
 
Importance of computers in military (2)
Importance of computers in military (2)Importance of computers in military (2)
Importance of computers in military (2)
 
Nursing technology informatics presentation
Nursing technology informatics presentationNursing technology informatics presentation
Nursing technology informatics presentation
 
Importance of computers in Military
Importance of computers in MilitaryImportance of computers in Military
Importance of computers in Military
 

Similar to Apache Wicket Web Framework

Web Components v1
Web Components v1Web Components v1
Web Components v1Mike Wilcox
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applicationselliando dias
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatiasapientindia
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...SPTechCon
 
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
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsMike Subelsky
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code IgniterAmzad Hossain
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892Tuna Tore
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentRob Windsor
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Eric Palakovich Carr
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Stephen Chin
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsSoós Gábor
 

Similar to Apache Wicket Web Framework (20)

Web Components v1
Web Components v1Web Components v1
Web Components v1
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
 
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
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web Apps
 
Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
 

Recently uploaded

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Apache Wicket Web Framework

  • 1. Apache Wicket Java Web Application Framework St. Louis - Java User’s Group Luther Baker • September 2009
  • 2. What is Wicket? • Web Application Framework • Component-based Framework • Wicket 1.4 is Java 1.5+ compliant
  • 3. Where does Wicket fit? User Presentation Tier (Wicket) Shared Business Tier Objects Integration Tier
  • 4. Request / Response JSP Request / Response home request jsp browser server response
  • 5. Model 2 (MVC) Struts, Spring MVC, Stripes home jsp request browser server response home controller
  • 6. Advantages of R/R • Rendering views is generally quite fast • Development can leverage existing tag libraries • Recruiting developers may be easier • Modern implementations have good support for DI and IoC frameworks
  • 7. Disadvantages of R/R • Controller implementations must explicitly consider multiple concurrent users and threads • Controllers generally work literally in terms of HTTP requests and responses • Controllers often explicitly manage state • Not strictly Object Oriented • The programming model is skewed
  • 8. The Impedance Mismatch The Programming Model • Programming in Java - do we regularly focus on how the JVM manages object instances and variables? • Generally, website development requires an understanding of the HTTP protocol. IE: manually managing state within and across requests forces front end handlers to be protocol specific.
  • 9. What if ... ? • What if we considered a page ... a Page? • What if we considered a button ... a Button? • And upon clicking a button, handled an onClick event? • What if web-development resembled Swing or event-driven development? • What kind of framework could possibly enable this?!
  • 10. Enter ... Wicket • Component-based framework • Instead of creating a controller, servlet or action class ... create a Page • Place components on said Page and define how each component reacts to user input • Build the Page in Java to manage HTML page elements ... not the other way around
  • 11. The Component Model The Underlying Abstraction • Graphic elements are laid out in HTML while their actual representation, behavior and implementation is defined in Java • A DOM style parent/child approach • An event-driven programming model • You wonder ... “How can such an abstraction sit on top of HTTP?”
  • 12. Web App Config web.xml <web-app> <context-param> <param-name>configuration</param-name> <param-value>development</param-value> </context-param> <filter> <filter-name>WebApplication</filter-name> <filter-class> org.apache.wicket.protocol.http.WicketFilter </filter-class> <init-param> <param-name>applicationClassName</param-name> <param-value>mypackage.HelloWorldApplication</param-value> </init-param> </filter> <filter-mapping> <filter-name>WebApplication</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
  • 13. Wicket Config WicketApplication.java package mypackage; import org.apache.wicket.protocol.http.WebApplication; public class HelloWorldApplication extends WebApplication { public Class getHomePage() { return HelloWorld.class; } }
  • 14. General Structure Markup (HTML’s Role) • Layout the element hierarchy • Style the elements Code (Java’s Role) • Mirror and implement markup’s element hierarchy • Event handling Properties Files (~Auxiliary Roles) • Literal strings and i18n
  • 15. Hello World Markup <html> <body> <span wicket:id="message">Message goes here!</span> </body> </html> Java import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; public class HelloWorld extends WebPage { public HelloWorld() { add(new Label("message", "Hello World!")); } }
  • 16. Forms (HTML) Markup <html> <body> <span wicket:id="message">Message goes here</span> <form wicket:id="messageInputForm"> <input type="text" wicket:id="messageInput"/> <input type="submit" value="update"/> </form> </body> </html>
  • 17. Forms (Java) Java public class HelloWorld extends WebPage { public HelloWorld() { IModel messageModel = new Model("Hello World!"); add(new Label("message", messageModel)); add(new MessageForm("messageInputForm", messageModel)); } private final class MessageForm extends Form { public MessageForm(String id, IModel model) { super(id); add(new TextField("messageInput", model)); } protected void onSubmit() { // nothing to do here as the model is automatically updated } } }
  • 18. Component Family Component Page WebComponent Link Panel WebPage AjaxLink Button Checkbox TextArea Form TextField DropDown Label ...many more
  • 19. Super Models • Static Model • Dynamic Model • Property Model • Compound Property • Loadable Detached
  • 20. Basic Models Static Model public class HelloWorld extends WicketExamplePage { public HelloWorld() { add(new Label ("name", new Model(person.getName()))); } } Dynamic Model personForm.add(new RequiredTextField("personName", new IModel<String>() { @Override public String getObject() { return person.getName(); } @Override public void setObject(String value) { person.setName(value); } }));
  • 21. More Models Property Model public PropertyModel(final Object modelObject, final String expression) class Person class Address { { private Address address; private String zip; public Address getAddress() public String getZip() { { return name; return zip; } } ... ... } } personForm.add(new RequiredTextField("zip", new PropertyModel<Person>(person, "address.zip")));
  • 22. Demonstration WebPage Component • Java • HTML Subclass Master Page child & parent tags Custom Component • Java, HTML • Child components • Panel Superclass • Tags to include Event Handling • Original HTML • Ajax (Debug) • Generated Javascript • Submit handling
  • 23. Ideally Suited For ... • Highly interactive apps • Help-Desk style ticketing applications and online Registration applications • Apps with lots of Forms and/or UI controls • Apps requiring seamless Ajax behavior • Apps simulating thick clients • Anytime an event programming model better suites the problem domain
  • 24. Deeper Dive Maven Quickstart Archetype • An easy way to start with a simple, Mavenized, Wicket project Other Topics • More on Models, Sessions and Security • Unit Testing • Custom components • URL mapping, IoC Integration, Persistence ...
  • 25. Wicket Resources Wicket Links • http://wicket.apache.org/ • http://wicketstuff.org/ • http://cwiki.apache.org/WICKET/ Wicket Books • Wicket in Action (Manning) • Pro Wicket (Apress)