SlideShare a Scribd company logo
1 of 150
Introducing
Apache Wicket
Martijn Dashorst
Agenda


ā€¢   Introduction to Apache Wicket
ā€¢   New and noteworthy in 1.5
ā€¢   Questions
Martijn Dashorst

ā€¢   Employee @ Topicus
ā€¢   Chair for Apache Wicket
ā€¢   Committer
ā€¢   Apache Member
ā€¢   Author Wicket in Action
Introduction
Wicket is...
a component oriented web framework
using just HTML and Java
Apache Wicket

ā€¢   Open Source: ASL 2.0
ā€¢   Created in 2004
ā€¢   Java web framework
ā€¢   Component oriented
ā€¢   http://wicket.apache.org
Whoā€™s using Wicket?
mobile.walmart.com supports three categories
of devices using the same Java code (only the html
is (very) different.)

Try doing that with JSP.
           ā€” Joachim Kainz
... We at Vegas.com have been able to re-
purpose our Wicket-based air/hotel search
application and purchase/checkout application.
This is the new mexico.com. [...]

The re-use of components and abstract pages
was tremendous.

      ā€”Scott Swank, chief architect vegas.com
Just HTML
Sign up form




Example from Railscast episode #250
Sign up form
Sign up form
  <h1>Sign Up</h1>

  <form>
   <div class="error_messages">
    <h2>Form is invalid</h2>
    <ul>
     <li>Some error message</li>
    </ul>
   </div>
   <p>
    <label for="email">E-Mail</label><br/>
    <input type="email" id="email" />
   </p>
   <p>
    <label for="password">Password</label>
    <input type="password" id="password" />
   </p>
   <p>
    <label for="conļ¬rm">Password conļ¬rmat
    <input type="password" id="conļ¬rm" />
   </p>
   <p class="button"><input type="submit" va
Sign up form
Sign up form
  <h1>SignĀ Up</h1>Ā Ā 
  Ā Ā 
  <%=Ā form_forĀ @userĀ doĀ |f|Ā %>Ā Ā 
  Ā Ā <%Ā ifĀ @user.errors.any?Ā %>Ā Ā 
  Ā Ā Ā Ā <divĀ class="error_messages">Ā Ā 
  Ā Ā Ā Ā Ā Ā <h2>FormĀ isĀ invalid</h2>Ā Ā 
  Ā Ā Ā Ā Ā Ā <ul>Ā Ā 
  Ā Ā Ā Ā Ā Ā Ā Ā <%Ā forĀ messageĀ inĀ @user.errors.fullĀ Ā 
  Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā <li><%=Ā messageĀ %></li>Ā Ā 
  Ā Ā Ā Ā Ā Ā Ā Ā <%Ā endĀ %>Ā Ā 
  Ā Ā Ā Ā Ā Ā </ul>Ā Ā 
  Ā Ā Ā Ā </div>Ā Ā 
  Ā Ā <%Ā endĀ %>Ā Ā 
  Ā Ā <p>Ā Ā 
  Ā Ā Ā Ā <%=Ā f.labelĀ :emailĀ %><brĀ />Ā Ā 
  Ā Ā Ā Ā <%=Ā f.text_ļ¬eldĀ :emailĀ %>Ā Ā 
  Ā Ā </p>Ā Ā 
  Ā Ā <p>Ā Ā 
  Ā Ā Ā Ā <%=Ā f.labelĀ :passwordĀ %><brĀ />Ā Ā 
  Ā Ā Ā Ā <%=Ā f.password_ļ¬eldĀ :passwordĀ %>Ā Ā 
  Ā Ā </p>Ā Ā 
  Ā Ā <p>
Sign up form
  <h1>Sign Up</h1>

  <form>
   <div class="error_messages">
    <h2>Form is invalid</h2>
    <ul>
     <li>Some error message</li>
    </ul>
   </div>
   <p>
    <label for="email">E-Mail</label><br/>
    <input type="email" id="email" />
   </p>
   <p>
    <label for="password">Password</label>
    <input type="password" id="password" />
   </p>
   <p>
    <label for="conļ¬rm">Password conļ¬rmat
    <input type="password" id="conļ¬rm" />
   </p>
   <p class="button"><input type="submit" va
Sign up form
  <h1>Sign Up</h1>

  <form>
   <div wicket:id="feedback" class="error_me
    <h2>Form is invalid</h2>
    <ul>
     <li>Some error message</li>
    </ul>
   </div>
   <p>
    <label for="email">E-Mail</label><br/>
    <input wicket:id="email" type="email" i
   </p>
   <p>
    <label for="password">Password</label>
    <input wicket:id="password" type="passw
   </p>
   <p>
    <label for="conļ¬rm">Password conļ¬rmat
    <input wicket:id="conļ¬rm" type="passwo
   </p>
   <p class="button"><input type="submit" va
Sign up form
  <h1>Sign Up</h1>

  <form>
   <div wicket:id="feedback" class="error_me
    <h2>Form is invalid</h2>
    <ul>
     <li>Some error message</li>
    </ul>
   </div>
   <p>
    <label for="email">E-Mail</label><br/>
    <input wicket:id="email" type="email" i
   </p>
   <p>
    <label for="password">Password</label>
    <input wicket:id="password" type="passw
   </p>
   <p>
    <label for="conļ¬rm">Password conļ¬rmat
    <input wicket:id="conļ¬rm" type="passwo
   </p>
   <p class="button"><input type="submit" va
<tag wicket:id="foo">
Instructs Wicket to work on this tag
Imperative markup
                               <h1>SignĀ Up</h1>

ā€¢   Used by Ruby on Rails,     <%=Ā form_forĀ @userĀ doĀ |f|Ā %>
                               Ā Ā <%Ā ifĀ @user.errors.any?Ā %>
    JSP, Play, Velocity, ...   Ā Ā Ā Ā <divĀ class="error_messag
                               Ā Ā Ā Ā Ā Ā <h2>FormĀ isĀ invalid</h

ā€¢
                               Ā Ā Ā Ā Ā Ā <ul>
    Great for web developers   Ā Ā Ā Ā Ā Ā Ā Ā <%Ā forĀ messageĀ inĀ @u
                               Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā <li><%=Ā messageĀ %>
ā€¢   Great for hacking on a     Ā Ā Ā Ā Ā Ā Ā Ā <%Ā endĀ %>
                               Ā Ā Ā Ā Ā Ā </ul>
    web site                   Ā Ā Ā Ā </div>
                               Ā Ā <%Ā endĀ %>
                               Ā Ā <p>
ā€¢   Code and markup are        Ā Ā Ā Ā <%=Ā f.labelĀ :emailĀ %><br
                               Ā Ā Ā Ā <%=Ā f.text_ļ¬eldĀ :emailĀ 
    not separated              Ā Ā </p>
                               Ā Ā <p>
Declarative markup
                                <h1>Sign Up</h1>

ā€¢   Used by Wicket, Tapestry,   <form wicket:id="form">
                                 <div class="error_message
    Facelets                     <p>
                                  <label for="email">E-Ma

ā€¢   Great for web designers
                                  <input type="email" id=
                                 </p>
                                 <p>
ā€¢   Go from PSD ā†’ HTML ā†’          <label for="password">P
                                  <input type="password"
    Page ā†’ Component             </p>
                                 <p>
                                  <label for="conļ¬rm">Pa
ā€¢   Code and markup are           <input type="password"
                                 </p>
    strictly separated           <p class="button"><input
                                </form>
Just Java
Sign up form
<h1>SignĀ Up</h1>Ā Ā 
Ā Ā 
<%=Ā form_forĀ @userĀ doĀ |f|Ā %>Ā Ā 
Ā Ā <%Ā ifĀ @user.errors.any?Ā %>Ā Ā 
Ā Ā Ā Ā <divĀ class="error_messages">Ā Ā 
Ā Ā Ā Ā Ā Ā <h2>FormĀ isĀ invalid</h2>Ā Ā 
Ā Ā Ā Ā Ā Ā <ul>Ā Ā 
Ā Ā Ā Ā Ā Ā Ā Ā <%Ā forĀ messageĀ inĀ @user.errors.full_messagesĀ %>Ā Ā 
Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā <li><%=Ā messageĀ %></li>Ā Ā 
Ā Ā Ā Ā Ā Ā Ā Ā <%Ā endĀ %>Ā Ā 
Ā Ā Ā Ā Ā Ā </ul>Ā Ā 
Ā Ā Ā Ā </div>Ā Ā 
Ā Ā <%Ā endĀ %>Ā Ā 
Ā Ā <p>Ā Ā 
Ā Ā Ā Ā <%=Ā f.labelĀ :emailĀ %><brĀ />Ā Ā 
Ā Ā Ā Ā <%=Ā f.text_ļ¬eldĀ :emailĀ %>Ā Ā 
Ā Ā </p>Ā Ā 
Ā Ā <p>Ā Ā 
Ā Ā Ā Ā <%=Ā f.labelĀ :passwordĀ %><brĀ />Ā Ā 
Ā Ā Ā Ā <%=Ā f.password_ļ¬eldĀ :passwordĀ %>Ā Ā 
Ā Ā </p>Ā Ā 
Ā Ā <p>Ā Ā 
Ā Ā Ā Ā <%=Ā f.labelĀ :password_conļ¬rmationĀ %>Ā Ā 
Sign up form
Form form = new Form("signup") {
  @Override
  public void onSubmit() {
     // ...
  }
}
add(form);
Sign up form
Form form = new Form("signup") {
  @Override
  public void onSubmit() {
     // ...
  }
}
add(form);

FeedbackPanel feedback = new FeedbackPanel("feedback");
feedback.setVisible(form.hasFeedbackMessages());
form.add(feedback);
Sign up form
Form form = new Form("signup") {
  @Override
  public void onSubmit() {
     // ...
  }
}
add(form);

FeedbackPanel feedback = new FeedbackPanel("feedback");
feedback.setVisible(form.hasFeedbackMessages());
form.add(feedback);

form.add(new EmailTextField("email", Model.of(""))
         .setRequired(true));
Sign up form
Form form = new Form("signup") {
  @Override
  public void onSubmit() {
     // ...
  }
}
add(form);

FeedbackPanel feedback = new FeedbackPanel("feedback");
feedback.setVisible(form.hasFeedbackMessages());
form.add(feedback);

form.add(new EmailTextField("email", Model.of(""))
         .setRequired(true));

form.add(new PasswordField("password", Model.of(""))
         .setRequired(true));
Sign up form
Form form = new Form("signup") {
  @Override
  public void onSubmit() {
     // ...
  }
}
add(form);

FeedbackPanel feedback = new FeedbackPanel("feedback");
feedback.setVisible(form.hasFeedbackMessages());
form.add(feedback);

form.add(new EmailTextField("email", Model.of(""))
         .setRequired(true));

form.add(new PasswordField("password", Model.of(""))
         .setRequired(true));

form.add(new PasswordField("conļ¬rm", Model.of(""))
         .setRequired(true));
Just Java

ā€¢   No logic in markup
ā€¢   Components are objects (use new and extends)
ā€¢   Use OO techniques in your programming
ā€¢   No XML
Concepts
Components
ā€¢   Manipulate markup
ā€¢   Render content
ā€¢   Receive events (onClick, onSubmit)


ā€¢   Examples:
    Label, Link, Form, TextField, PagingNavigator, Panel,
    Page, ClientSideImageMap
Models

ā€¢   Provide data to components
ā€¢   Store data for components
ā€¢   Transform data
ā€¢   Retrieve data from persistent storage


ā€¢   Examples: Model<T>, PropertyModel<T>
Behaviors

ā€¢   Decorator/Adapter for Component
ā€¢   Can manipulate markup of Component
ā€¢   Can receive events (onClick)
ā€¢   Add Ajax functionality to components
ā€¢   Example: AjaxSelfUpdatingTimerBehavior
Getting started
Wicket projects
ā€¢   Apache Wicket                                ā€¢   Leg before Wicket
    (extensions, spring, guice, velocity, etc)       (Maven archetypes)


ā€¢   Wicket stuff                                 ā€¢   Apache Isis
    (grand collection of projects)                   (incubating, DDD framework)


ā€¢   Seam for Apache                              ā€¢   Jolira Tools
    Wicket                                           (powers mobile.walmart.com)


ā€¢   WiQuery                                      ā€¢   Visural Wicket
                                                     (standalone Wicket components)
    (JQuery integration library)
Apache Wicket projects
ā€¢   Core          ā€¢   Velocity
ā€¢   Extensions    ā€¢   Auth/Roles
ā€¢   Quick start   ā€¢   JMX
ā€¢   IoC           ā€¢   Dev utils
    ā€¢   Spring
    ā€¢   Guice     ā€¢   Examples

ā€¢   DateTime
Wicket Stuff projects
ā€¢   progressbar              ā€¢   shiro-security                 ā€¢   theme

ā€¢   datatable-autocomplete   ā€¢   gae-initializer                ā€¢   yav

ā€¢   ļ¬‚ot                      ā€¢   push-jdk-1.5                   ā€¢   maven-support

ā€¢   googlecharts             ā€¢   jasperreports                  ā€¢   plugin

ā€¢   scala-extensions         ā€¢   mbeanview                      ā€¢   input-events

ā€¢   openlayers               ā€¢   jsr303                         ā€¢   javaee-inject

ā€¢   gmap2                    ā€¢   client-and-server-validation   ā€¢   push

ā€¢   inmethod-grid            ā€¢   multi-text-input               ā€¢   wicket-html5

ā€¢   minis                    ā€¢   prototype                      ā€¢   wicket-servlet3

ā€¢   phonebook                ā€¢   simile-timeline
Quick start
Quick start
Running quickstart
$_
Running quickstart
$ mvn -o archetype:generate -DarchetypeGroupId=org.apache.wicket -
DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.5-
SNAPSHOT -DgroupId=com.mycompany -DartifactId=myproject -
DarchetypeRepository=https://repository.apache.org/content/repositories/
snapshots/ -DinteractiveMode=false _
Running quickstart
$ mvn -o archetype:generate -DarchetypeGroupId=org.apache.wicket -
DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.5-
SNAPSHOT -DgroupId=com.mycompany -DartifactId=myproject -
DarchetypeRepository=https://repository.apache.org/content/repositories/
snapshots/ -DinteractiveMode=false
[INFO] Scanning for projects...
[INFO] -----------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] -----------------------------------------------------------
[INFO] >>> maven-archetype-plugin:2.0:generate (default-cli) >>>
[INFO] <<< maven-archetype-plugin:2.0:generate (default-cli) <<<
[INFO] --- maven-archetype-plugin:2.0:generate (default-cli) ---
[INFO] Generating project in Batch mode
[INFO] Archetype deļ¬ned by properties
[INFO] -----------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------------------
[INFO] Total time: 1.279s
[INFO] Finished at: Fri Feb 04 22:04:14 CET 2011
[INFO] Final Memory: 9M/81M
[INFO] -----------------------------------------------------------
Running quickstart
$ mvn jetty:run_
Running quickstart
$ mvn jetty:run
[INFO] Scanning for projects...
[INFO] -----------------------------------------------------------
[INFO] Building quickstart 1.0-SNAPSHOT
[INFO] -----------------------------------------------------------
[INFO] Starting jetty 7.2.2.v20101205 ...
2011-02-04 22:04:34.969:INFO::jetty-7.2.2.v20101205
2011-02-04 22:04:35.198:INFO::No Transaction manager found - if yo
INFO - WebXmlFile               - web.xml: found ļ¬lter with na
INFO - Application             - [wicket.myproject] init: Wick
INFO - RequestListenerInterface - registered listener interface
INFO - WebApplication             - [wicket.myproject] Started Wi
******************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.               ***
***                      ^^^^^^^^^^^               ***
*** Do NOT deploy to your live server(s) without changing this.***
*** See Application#getConļ¬gurationType() for more information***
******************************************************************
2011-02-04 22:04:35.464:INFO::Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
Running quickstart
Quick start alternative
           Leg up
           ā€¢   Spring
           ā€¢   Guice
           ā€¢   JDBC
           ā€¢   JPA
           ā€¢   Hibernate
           ā€¢   Scala

           http://jweekend.com/dev/LegUp
Want to learn more?
Want to learn more?
Want to learn more?

http://wicket.apache.org/learn/books.html
Examples
Examples
Hello, World!
Hello, World!
<h1>Hello, World</h1>
Hello, World!
<h1>[Replaced text]</h1>
Hello, World!
<h1 wicket:id="msg">[Replaced text]</h1>
Hello, World!
<h1 wicket:id="msg">[Replaced text]</h1>

                   +

 add(new Label("msg", "Hello, World!"));
Hello, World!
<h1 wicket:id="msg">[Replaced text]</h1>

                    +

  add(new Label("msg", "Hello, World!"));

                    =

        <h1>Hello, World!</h1>
Examples
Click counter
This link has been clicked 123 times
This link has been clicked 123 times

This link has been clicked 123 times!
This link has been clicked 123 times

This <a href="#">link</a> has been clicked 123
times!
This link has been clicked 123 times

This <a href="#">link</a> has been clicked
<span>123</span> times!
This link has been clicked 123 times

This <a wicket:id="link" href="#">link</a> has been
clicked <span>123</span> times!
This link has been clicked 123 times

This <a wicket:id="link" href="#">link</a> has been
clicked
<span wicket:id="clicks">123</span> times!
This link has been clicked 123 times

This <a wicket:id="link" href="#">link</a> has been
clicked
<span wicket:id="clicks">123</span> times!
This link has been clicked 123 times

public class ClickCountPage extends WebPage {
}
This link has been clicked 123 times

public class ClickCountPage extends WebPage {
  public ClickCountPage() {
  }
}
This link has been clicked 123 times

public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCountPage() {
    }
}
This link has been clicked 123 times

public class ClickCountPage extends WebPage {
 private int clicks = 0;

 public ClickCountPage() {
   add(new Link<Void>("link") {
      public void onClick() {
        clicks++;
      }
    });
 }
This link has been clicked 123 times

public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCountPage() {
      add(new Link<Void>("link") { ... });
      add(new Label("clicks",
          new PropertyModel<Integer>(this,
                "clicks")));
    }
}
Wicket for developers
2 modes for your app
Development and Deployment
Development mode
$ mvn jetty:run
[INFO] Scanning for projects...
[INFO] -----------------------------------------------------------
[INFO] Building quickstart 1.0-SNAPSHOT
[INFO] -----------------------------------------------------------
[INFO] Starting jetty 7.2.2.v20101205 ...
2011-02-04 22:04:34.969:INFO::jetty-7.2.2.v20101205
2011-02-04 22:04:35.198:INFO::No Transaction manager found - if yo
INFO - WebXmlFile               - web.xml: found ļ¬lter with na
INFO - Application             - [wicket.myproject] init: Wick
INFO - RequestListenerInterface - registered listener interface
INFO - WebApplication             - [wicket.myproject] Started Wi
******************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.               **
***                      ^^^^^^^^^^^               **
*** Do NOT deploy to your live server(s) without changing this. **
*** See Application#getConļ¬gurationType() for more information **
******************************************************************
2011-02-04 22:04:35.464:INFO::Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
Development mode
ā€¢   exceptional error pages
ā€¢   dynamic markup reloading
ā€¢   no caching
ā€¢   no javascript/css optimizations
ā€¢   discover mistakes early (serialization, missing
    components, ...)
ā€¢   Wicket debugger visible
Deployment mode

ā€¢   Cache markup resources
ā€¢   No checks
ā€¢   Donā€™t display stack traces to users
ā€¢   Minimize/compress JavaScript
ā€¢   Donā€™t generate wicket tags
ā€¢   Wicket debugger not visible
FREE PRO TIP:

Donā€™t perform your performance tests
in development mode!
Ajax debugger
Ajax debugger
Ajax envelope
<?xml version="1.0" encoding="UTF-8"?>
<ajax-response>
 <component id="count2">
  <![CDATA[<span wicket:id="count" id="count2">1</span>]]>
 </component>
</ajax-response>
Error message
Unable to ļ¬nd component with id 'count'
in HomePage.
This means that you declared
wicket:id=count in your markup, but that
you either did not add the component to
your page at all, or that the hierarchy does
not match.
Error pages
Testing the UI
WicketTester

ā€¢   Test components directly, or their markup
ā€¢   Runs tests without starting server
ā€¢   Ajax testing (server side)
ā€¢   Runs in IDE, ant, maven builds
ā€¢   Achieves high code coverage
Testing Hello, World!
@Test
public void rendersWelcomeMessage() {
}
Testing Hello, World!
@Test
public void rendersWelcomeMessage() {
  WicketTester tester = new WicketTester();
}
Testing Hello, World!
@Test
public void rendersWelcomeMessage() {
  WicketTester tester = new WicketTester();
  tester.startPage(HelloWorldPage.class);
}
Testing Hello, World!
@Test
public void rendersWelcomeMessage() {
  WicketTester tester = new WicketTester();
  tester.startPage(HelloWorldPage.class);
  tester.assertLabel("msg", "Hello, World!");
}
Testing Click Count
@Test
public void clicksIncreaseCount() {
}
Testing Click Count
@Test
public void clicksIncreaseCount() {
  WicketTester tester = new WicketTester();
}
Testing Click Count
@Test
public void clicksIncreaseCount() {
  WicketTester tester = new WicketTester();
  tester.startPage(ClickCountPage.class);
}
Testing Click Count
@Test
public void clicksIncreaseCount() {
  WicketTester tester = new WicketTester();
  tester.startPage(ClickCountPage.class);
  tester.assertModelValue("clicks", 0);
}
Testing Click Count
@Test
public void clicksIncreaseCount() {
  WicketTester tester = new WicketTester();
  tester.startPage(ClickCountPage.class);
  tester.assertModelValue("clicks", 0);
  tester.clickLink("link");
}
Testing Click Count
@Test
public void clicksIncreaseCount() {
  WicketTester tester = new WicketTester();
  tester.startPage(ClickCountPage.class);
  tester.assertModelValue("clicks", 0);
  tester.clickLink("link");
  tester.assertModelValue("clicks", 1);
}
Other test frameworks


ā€¢   PageTest (by Kent Tong)
ā€¢   JDave (BDD framework)
Summary

ā€¢   Widely used
ā€¢   Component oriented
ā€¢   Java
ā€¢   Open Source (ASL 2.0)
Whatā€™s new in 1.5?
HTML 5 support
Pre 1.5


ā€¢   Checks for valid markup donā€™t accept new ļ¬eld types
ā€¢   HTML 5 deļ¬nes:
    <input type=ā€text|email|password|number|date|
    search|url|...ā€>
Wicket 1.5

ā€¢   EmailTextField
ā€¢   NumberTextField
ā€¢   UrlTextField
ā€¢   RangeTextField
Improved internals
Split up core library
ā€¢   Old:
    ā€¢   wicket.jar
Split up core library
ā€¢   Old:
    ā€¢   wicket.jar
ā€¢   New:
    ā€¢   wicket-requests.jar
    ā€¢   wicket-util.jar
    ā€¢   wicket-core.jar
Maven users
<dependency>
  <groupId>org.apache.wicket</groupId>
  <artifactId>wicket-core</artifactId>
  <version>1.5-RC1</version>
</dependency>
Simpler request cycle
Wicket < 1.5

ā€¢   Decoding request and handling in state machine
ā€¢   Debugging ā€˜interestingā€™
ā€¢   Designed for ļ¬‚exibility
ā€¢   Served its purposeā€”took on 4 years of engineering
Wicket 1.5


ā€¢   Request cycle processing completely rewritten
ā€¢   Rendering code has been improved and simpliļ¬ed
ā€¢   URL rendering simpliļ¬ed: now in one place
Wicket < 1.5

ā€¢   Custom request cycle: subclass WebRequestCycle
ā€¢   Problematic with add-ons:
    ā€¢   HibernateRequestCycle
    ā€¢   SecureRequestCycle
    ā€¢   ActivityRequestCycle
New: RequestCycleListener
public interface IRequestCycleListener {

    void onBeginRequest(RequestCycle cycle);

    void onEndRequest(RequestCycle cycle);

    void onDetach(RequestCycle cycle);

    IRequestHandler onException(RequestCycle cycle, Exception ex);
}
RequestCycleListener
public class SomeWebApplication extends WebApplication {
  @Override
  protected void init() {
  }

    @Override
    public Class<? extends Page> getHomePage() {
      return SomePage.class;
    }
}
RequestCycleListener
public class SomeWebApplication extends WebApplication {
  @Override
  protected void init() {
     addRequestCycleListener(new IRequestCycleListener() {
        public void onBeginRequest() {
           // do something at the beginning of the request
        }

              public void onEndRequest() {
                // do something at the end of the request
              }

              public void onException(Exception ex) {
                // do something here when there's an exception
              }
        });
    }

    @Override
    public Class<? extends Page> getHomePage() {
      return SomePage.class;
    }
}
Switching to HTTPS
Switching to HTTPS
public SecurePage extends WebPage {
  ...
}

public MyApplications extends WebApplication {
 @Override
 public void init() {
  super.init();

    }
}
Switching to HTTPS
@RequireHttps
public SecurePage extends WebPage {
  ...
}

public MyApplications extends WebApplication {
 @Override
 public void init() {
  super.init();

    }
}
Switching to HTTPS
@RequireHttps
public SecurePage extends WebPage {
  ...
}

public MyApplications extends WebApplication {
  @Override
  public void init() {
    super.init();
    setRootRequestMapper(
      new HttpsMapper(getRootRequestMapper(),
                  new HttpsConļ¬g());
  }
}
Component event bus
Component event bus

ā€¢   IEventSource: objects that send events
    <T> void send(IEventSink sink,
                      Broadcast broadcast, T payload);
ā€¢   IEventSink: objects that receive events
    void onEvent(IEvent<?> event);
ā€¢   Participants: Components, RequestCycle, Session and
    Application
Event bus example
Ajax link counter
This link has been clicked 123 times
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new Link<Void>("link") {
          @Override
          public void onClick() {
            count++;
          }
        });
      add(new Label("clicks",
               new PropertyModel<Integer>(this, "clicks")));
    }
}
This link has been clicked 123 times
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new Link<Void>("link") {
          @Override
          public void onClick() {
            count++;
          }
        });
      add(new Label("clicks",
                new PropertyModel<Integer>(this, "clicks"))
            .setOutputMarkupId(true));
    }
}
This link has been clicked 123 times
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") {
          @Override
          public void onClick(AjaxRequestTarget target) {
            count++;
          }
        });
      add(new Label("clicks",
                new PropertyModel<Integer>(this, "clicks"))
            .setOutputMarkupId(true));
    }
}
This link has been clicked 123 times
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") {
          @Override
          public void onClick(AjaxRequestTarget target) {
            count++;
             target.add(getPage().get("count"));
          }
        });
      add(new Label("count",
                new PropertyModel<Integer>(this, "clicks"))
            .setOutputMarkupId(true));
    }
}
This link has been clicked 123 times
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") {
          @Override
          public void onClick(AjaxRequestTarget target) {
            count++;
            target.add(getPage().get("count"));
          }
        });
      add(new Label("count",
                new PropertyModel<Integer>(this, "clicks"))
            .setOutputMarkupId(true));
    }
}
Pre-event bus

ā€¢   Link needs to know the updatable components
ā€¢   Makes code brittle, hard to maintain


ā€¢   Better:
    ā€¢   Let the label refresh itself with each Ajax request
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") {
          @Override
          public void onClick(AjaxRequestTarget target) {
            count++;
             target.add(getPage().get("count"));
          }
        });
      add(new Label("count",
                new PropertyModel<Integer>(this, "clicks"))
            .setOutputMarkupId(true));
    }
}
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") {
          @Override
          public void onClick(AjaxRequestTarget target) {
            count++;
             send(getPage(), Broadcast.BREADTH, target);
          }
        });
      add(new Label("count",
                new PropertyModel<Integer>(this, "clicks"))
            .setOutputMarkupId(true));
    }
}
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") {
          @Override
          public void onClick(AjaxRequestTarget target) {
            count++;
            send(getPage(), Broadcast.BREADTH, target);
          }
        });
      add(new CountLabel("count", new PropertyModel<Integer>(this,
    }
}
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") { ... });
      add(new CountLabel("count", new PropertyModel<Integer>(this,
    }

    public class CountLabel extends Label {
    }
}
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") { ... });
      add(new CountLabel("count", new PropertyModel<Integer>(this,
    }

    public class CountLabel extends Label {
      public CountLabel(String id, IModel<Integer> model) {
        super(id, model);
      }
    }
}
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") { ... });
      add(new CountLabel("count", new PropertyModel<Integer>(this,
    }

    public class CountLabel extends Label {
      public CountLabel(String id, IModel<Integer> model) {
        super(id, model);
        setOutputMarkupId(true);
      }
    }
}
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") { ... });
      add(new CountLabel("count", new PropertyModel<Integer>(this,
    }

    public class CountLabel extends Label {
     public CountLabel(String id, IModel<Integer> model) {
       super(id, model);
       setOutputMarkupId(true);
     }

        @Override
        public void onEvent(IEvent<?> event) {
          super.onEvent(event);
        }
    }
}
public class ClickCountPage extends WebPage {
 private int clicks = 0;

    public ClickCount() {
      add(new AjaxLink<Void>("link") { ... });
      add(new CountLabel("count", new PropertyModel<Integer>(this,
    }

    public class CountLabel extends Label {
     public CountLabel(String id, IModel<Integer> model) {
       super(id, model);
       setOutputMarkupId(true);
     }

        @Override
        public void onEvent(IEvent<?> event) {
         super.onEvent(event);

            if (event.getPayload() instanceof AjaxRequestTarget) {
              AjaxRequestTarget target =
                          (AjaxRequestTarget) event.getPayload();
              target.add(this);
            }
        }
    }
}
Post-event bus

ā€¢   A bit more code
ā€¢   Updates are now completely decoupled
ā€¢   Make the payload type safe and meaningful:
    no AjaxRequestTarget, but CountEvent
ā€¢   AJAX requests trigger a default event with an
    AjaxRequestTarget as payload
And much, much more:
http://cwiki.apache.org/WICKET/
migration-to-wicket15.html
Thank you!
    Questions? Ask!

More Related Content

What's hot

HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsJames Pearce
Ā 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5dynamis
Ā 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web appsIvano Malavolta
Ā 
DirectToWeb 2.0
DirectToWeb 2.0DirectToWeb 2.0
DirectToWeb 2.0WO Community
Ā 
Backbone JS for mobile apps
Backbone JS for mobile appsBackbone JS for mobile apps
Backbone JS for mobile appsIvano Malavolta
Ā 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWebDave Bouwman
Ā 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtmlsagaroceanic11
Ā 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Aaron Gustafson
Ā 
Rails for Mobile Devices @Ā Conferencia Rails 2011
Rails for Mobile Devices @Ā Conferencia Rails 2011Rails for Mobile Devices @Ā Conferencia Rails 2011
Rails for Mobile Devices @Ā Conferencia Rails 2011Alberto Perdomo
Ā 
Rails + Webpack
Rails + WebpackRails + Webpack
Rails + WebpackKhor SoonHin
Ā 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Hendrik Ebbers
Ā 
[FEConf Korea 2017]Angular į„į…„į†·į„‘į…©į„‚į…„į†«į„į…³ į„ƒį…¢į„’į…Ŗį„‡į…„į†ø
[FEConf Korea 2017]Angular į„į…„į†·į„‘į…©į„‚į…„į†«į„į…³ į„ƒį…¢į„’į…Ŗį„‡į…„į†ø[FEConf Korea 2017]Angular į„į…„į†·į„‘į…©į„‚į…„į†«į„į…³ į„ƒį…¢į„’į…Ŗį„‡į…„į†ø
[FEConf Korea 2017]Angular į„į…„į†·į„‘į…©į„‚į…„į†«į„į…³ į„ƒį…¢į„’į…Ŗį„‡į…„į†øJeado Ko
Ā 
Why Django for Web Development
Why Django for Web DevelopmentWhy Django for Web Development
Why Django for Web DevelopmentMorteza Zohoori Shoar
Ā 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1James Pearce
Ā 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Gil Fink
Ā 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsJulien Lecomte
Ā 
Templates
TemplatesTemplates
Templatessoon
Ā 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptfranksvalli
Ā 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuAppUniverz Org
Ā 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and PluginsMarc Grabanski
Ā 

What's hot (20)

HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
Ā 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
Ā 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web apps
Ā 
DirectToWeb 2.0
DirectToWeb 2.0DirectToWeb 2.0
DirectToWeb 2.0
Ā 
Backbone JS for mobile apps
Backbone JS for mobile appsBackbone JS for mobile apps
Backbone JS for mobile apps
Ā 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
Ā 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
Ā 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]Web Standards: Fueling Innovation [Web Design World Boston '08]
Web Standards: Fueling Innovation [Web Design World Boston '08]
Ā 
Rails for Mobile Devices @Ā Conferencia Rails 2011
Rails for Mobile Devices @Ā Conferencia Rails 2011Rails for Mobile Devices @Ā Conferencia Rails 2011
Rails for Mobile Devices @Ā Conferencia Rails 2011
Ā 
Rails + Webpack
Rails + WebpackRails + Webpack
Rails + Webpack
Ā 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)
Ā 
[FEConf Korea 2017]Angular į„į…„į†·į„‘į…©į„‚į…„į†«į„į…³ į„ƒį…¢į„’į…Ŗį„‡į…„į†ø
[FEConf Korea 2017]Angular į„į…„į†·į„‘į…©į„‚į…„į†«į„į…³ į„ƒį…¢į„’į…Ŗį„‡į…„į†ø[FEConf Korea 2017]Angular į„į…„į†·į„‘į…©į„‚į…„į†«į„į…³ į„ƒį…¢į„’į…Ŗį„‡į…„į†ø
[FEConf Korea 2017]Angular į„į…„į†·į„‘į…©į„‚į…„į†«į„į…³ į„ƒį…¢į„’į…Ŗį„‡į…„į†ø
Ā 
Why Django for Web Development
Why Django for Web DevelopmentWhy Django for Web Development
Why Django for Web Development
Ā 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1
Ā 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Ā 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
Ā 
Templates
TemplatesTemplates
Templates
Ā 
Mobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScriptMobile HTML, CSS, and JavaScript
Mobile HTML, CSS, and JavaScript
Ā 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Ā 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
Ā 

Viewers also liked

Wicket体éØ“č«‡
Wicket体éØ“č«‡Wicket体éØ“č«‡
Wicket体éØ“č«‡Hiroto Yamakawa
Ā 
Project Lombok!
Project Lombok!Project Lombok!
Project Lombok!Mehdi Haryani
Ā 
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
Ā 
Lombok ćƒćƒ³ć‚ŗć‚Ŗćƒ³
Lombok ćƒćƒ³ć‚ŗć‚Ŗćƒ³Lombok ćƒćƒ³ć‚ŗć‚Ŗćƒ³
Lombok ćƒćƒ³ć‚ŗć‚Ŗćƒ³Hiroto Yamakawa
Ā 
Lombokć®ć‚¹ć‚¹ćƒ”
Lombokć®ć‚¹ć‚¹ćƒ”Lombokć®ć‚¹ć‚¹ćƒ”
Lombokć®ć‚¹ć‚¹ćƒ”ćŖć¹
Ā 
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
Ā 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...Gerke Max Preussner
Ā 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket IntroductionEyal Golan
Ā 

Viewers also liked (10)

Wicket体éØ“č«‡
Wicket体éØ“č«‡Wicket体éØ“č«‡
Wicket体éØ“č«‡
Ā 
Project Lombok!
Project Lombok!Project Lombok!
Project Lombok!
Ā 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6
Ā 
Lombok ćƒćƒ³ć‚ŗć‚Ŗćƒ³
Lombok ćƒćƒ³ć‚ŗć‚Ŗćƒ³Lombok ćƒćƒ³ć‚ŗć‚Ŗćƒ³
Lombok ćƒćƒ³ć‚ŗć‚Ŗćƒ³
Ā 
Lombokć®ć‚¹ć‚¹ćƒ”
Lombokć®ć‚¹ć‚¹ćƒ”Lombokć®ć‚¹ć‚¹ćƒ”
Lombokć®ć‚¹ć‚¹ćƒ”
Ā 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
Ā 
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
Ā 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
Ā 
Wicket Introduction
Wicket IntroductionWicket Introduction
Wicket Introduction
Ā 

Similar to Wicket 2010

Mobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLsMobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLsHarvard Web Working Group
Ā 
Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2RORLAB
Ā 
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5Tieturi Oy
Ā 
QuickConnect
QuickConnectQuickConnect
QuickConnectAnnu G
Ā 
GitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scalatakezoe
Ā 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Arun Gupta
Ā 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineYared Ayalew
Ā 
PHPConf-TW 2012 # Twig
PHPConf-TW 2012 # TwigPHPConf-TW 2012 # Twig
PHPConf-TW 2012 # TwigWake Liu
Ā 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesMark Rackley
Ā 
Utilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done FasterUtilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done FasterMark Rackley
Ā 
django_introduction20141030
django_introduction20141030django_introduction20141030
django_introduction20141030Kevin Wu
Ā 
Web Components for Java Developers
Web Components for Java DevelopersWeb Components for Java Developers
Web Components for Java DevelopersJoonas Lehtinen
Ā 
Polytechnic speaker deck oluwadamilare
Polytechnic speaker deck oluwadamilarePolytechnic speaker deck oluwadamilare
Polytechnic speaker deck oluwadamilareOluwadamilare Ibrahim
Ā 
Polytechnic speaker deck oluwadamilare
Polytechnic speaker deck oluwadamilarePolytechnic speaker deck oluwadamilare
Polytechnic speaker deck oluwadamilareOluwadamilare Ibrahim
Ā 
`From Prototype to Drupal` by Andrew Ivasiv
`From Prototype to Drupal` by Andrew Ivasiv`From Prototype to Drupal` by Andrew Ivasiv
`From Prototype to Drupal` by Andrew IvasivLemberg Solutions
Ā 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQueryMark Rackley
Ā 
Introduction to web components
Introduction to web componentsIntroduction to web components
Introduction to web componentsMarc BƤchinger
Ā 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointMark Rackley
Ā 

Similar to Wicket 2010 (20)

Mobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLsMobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLs
Ā 
Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2
Ā 
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
Ā 
QuickConnect
QuickConnectQuickConnect
QuickConnect
Ā 
GitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scala
Ā 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Ā 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
Ā 
PHPConf-TW 2012 # Twig
PHPConf-TW 2012 # TwigPHPConf-TW 2012 # Twig
PHPConf-TW 2012 # Twig
Ā 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery Libraries
Ā 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
Ā 
Utilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done FasterUtilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done Faster
Ā 
django_introduction20141030
django_introduction20141030django_introduction20141030
django_introduction20141030
Ā 
Semantic UI Introduction
Semantic UI IntroductionSemantic UI Introduction
Semantic UI Introduction
Ā 
Web Components for Java Developers
Web Components for Java DevelopersWeb Components for Java Developers
Web Components for Java Developers
Ā 
Polytechnic speaker deck oluwadamilare
Polytechnic speaker deck oluwadamilarePolytechnic speaker deck oluwadamilare
Polytechnic speaker deck oluwadamilare
Ā 
Polytechnic speaker deck oluwadamilare
Polytechnic speaker deck oluwadamilarePolytechnic speaker deck oluwadamilare
Polytechnic speaker deck oluwadamilare
Ā 
`From Prototype to Drupal` by Andrew Ivasiv
`From Prototype to Drupal` by Andrew Ivasiv`From Prototype to Drupal` by Andrew Ivasiv
`From Prototype to Drupal` by Andrew Ivasiv
Ā 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
Ā 
Introduction to web components
Introduction to web componentsIntroduction to web components
Introduction to web components
Ā 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
Ā 

More from Martijn Dashorst

HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0Martijn Dashorst
Ā 
From Floppy Disks to Cloud Deployments
From Floppy Disks to Cloud DeploymentsFrom Floppy Disks to Cloud Deployments
From Floppy Disks to Cloud DeploymentsMartijn Dashorst
Ā 
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQLConverting 85% of Dutch Primary Schools from Oracle to PostgreSQL
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQLMartijn Dashorst
Ā 
Solutions for when documentation fails
Solutions for when documentation fails Solutions for when documentation fails
Solutions for when documentation fails Martijn Dashorst
Ā 
Whats up with wicket 8 and java 8
Whats up with wicket 8 and java 8Whats up with wicket 8 and java 8
Whats up with wicket 8 and java 8Martijn Dashorst
Ā 
Code review drinking game
Code review drinking gameCode review drinking game
Code review drinking gameMartijn Dashorst
Ā 
Java Serialization Deep Dive
Java Serialization Deep DiveJava Serialization Deep Dive
Java Serialization Deep DiveMartijn Dashorst
Ā 
Code review drinking game
Code review drinking gameCode review drinking game
Code review drinking gameMartijn Dashorst
Ā 
Scrum: van praktijk naar onderwijs
Scrum: van praktijk naar onderwijsScrum: van praktijk naar onderwijs
Scrum: van praktijk naar onderwijsMartijn Dashorst
Ā 
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)Martijn Dashorst
Ā 
Wicket 10 years and beyond
Wicket   10 years and beyond Wicket   10 years and beyond
Wicket 10 years and beyond Martijn Dashorst
Ā 
Apache Wicket and Java EE sitting in a tree
Apache Wicket and Java EE sitting in a treeApache Wicket and Java EE sitting in a tree
Apache Wicket and Java EE sitting in a treeMartijn Dashorst
Ā 
Vakmanschap is meesterschap
Vakmanschap is meesterschapVakmanschap is meesterschap
Vakmanschap is meesterschapMartijn Dashorst
Ā 
Keep your Wicket application in production
Keep your Wicket application in productionKeep your Wicket application in production
Keep your Wicket application in productionMartijn Dashorst
Ā 
Wicket In Action - oredev2008
Wicket In Action - oredev2008Wicket In Action - oredev2008
Wicket In Action - oredev2008Martijn Dashorst
Ā 
Guide To Successful Graduation at Apache
Guide To Successful Graduation at ApacheGuide To Successful Graduation at Apache
Guide To Successful Graduation at ApacheMartijn Dashorst
Ā 
Wicket Live on Stage
Wicket Live on StageWicket Live on Stage
Wicket Live on StageMartijn Dashorst
Ā 

More from Martijn Dashorst (20)

HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
Ā 
From Floppy Disks to Cloud Deployments
From Floppy Disks to Cloud DeploymentsFrom Floppy Disks to Cloud Deployments
From Floppy Disks to Cloud Deployments
Ā 
SOLID principles
SOLID principlesSOLID principles
SOLID principles
Ā 
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQLConverting 85% of Dutch Primary Schools from Oracle to PostgreSQL
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL
Ā 
Solutions for when documentation fails
Solutions for when documentation fails Solutions for when documentation fails
Solutions for when documentation fails
Ā 
Whats up with wicket 8 and java 8
Whats up with wicket 8 and java 8Whats up with wicket 8 and java 8
Whats up with wicket 8 and java 8
Ā 
Code review drinking game
Code review drinking gameCode review drinking game
Code review drinking game
Ā 
Java Serialization Deep Dive
Java Serialization Deep DiveJava Serialization Deep Dive
Java Serialization Deep Dive
Ā 
Code review drinking game
Code review drinking gameCode review drinking game
Code review drinking game
Ā 
Scrum: van praktijk naar onderwijs
Scrum: van praktijk naar onderwijsScrum: van praktijk naar onderwijs
Scrum: van praktijk naar onderwijs
Ā 
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Ā 
De schone coder
De schone coderDe schone coder
De schone coder
Ā 
Wicket 10 years and beyond
Wicket   10 years and beyond Wicket   10 years and beyond
Wicket 10 years and beyond
Ā 
Apache Wicket and Java EE sitting in a tree
Apache Wicket and Java EE sitting in a treeApache Wicket and Java EE sitting in a tree
Apache Wicket and Java EE sitting in a tree
Ā 
Vakmanschap is meesterschap
Vakmanschap is meesterschapVakmanschap is meesterschap
Vakmanschap is meesterschap
Ā 
Keep your Wicket application in production
Keep your Wicket application in productionKeep your Wicket application in production
Keep your Wicket application in production
Ā 
Wicket In Action - oredev2008
Wicket In Action - oredev2008Wicket In Action - oredev2008
Wicket In Action - oredev2008
Ā 
Guide To Successful Graduation at Apache
Guide To Successful Graduation at ApacheGuide To Successful Graduation at Apache
Guide To Successful Graduation at Apache
Ā 
Wicket In Action
Wicket In ActionWicket In Action
Wicket In Action
Ā 
Wicket Live on Stage
Wicket Live on StageWicket Live on Stage
Wicket Live on Stage
Ā 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
Ā 
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
Ā 
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
Ā 
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
Ā 
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
Ā 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
Ā 
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
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
Ā 
Swan(sea) Song ā€“ personal research during my six years at Swansea ... and bey...
Swan(sea) Song ā€“ personal research during my six years at Swansea ... and bey...Swan(sea) Song ā€“ personal research during my six years at Swansea ... and bey...
Swan(sea) Song ā€“ personal research during my six years at Swansea ... and bey...Alan Dix
Ā 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024The Digital Insurer
Ā 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
Ā 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
Ā 
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
Ā 
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
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
Ā 
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
Ā 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Ā 
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...
Ā 
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
Ā 
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
Ā 
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
Ā 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Ā 
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
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Ā 
Swan(sea) Song ā€“ personal research during my six years at Swansea ... and bey...
Swan(sea) Song ā€“ personal research during my six years at Swansea ... and bey...Swan(sea) Song ā€“ personal research during my six years at Swansea ... and bey...
Swan(sea) Song ā€“ personal research during my six years at Swansea ... and bey...
Ā 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024
Ā 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Ā 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Ā 
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 ...
Ā 
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
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Ā 
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
Ā 

Wicket 2010

  • 2. Agenda ā€¢ Introduction to Apache Wicket ā€¢ New and noteworthy in 1.5 ā€¢ Questions
  • 3. Martijn Dashorst ā€¢ Employee @ Topicus ā€¢ Chair for Apache Wicket ā€¢ Committer ā€¢ Apache Member ā€¢ Author Wicket in Action
  • 5. Wicket is... a component oriented web framework using just HTML and Java
  • 6. Apache Wicket ā€¢ Open Source: ASL 2.0 ā€¢ Created in 2004 ā€¢ Java web framework ā€¢ Component oriented ā€¢ http://wicket.apache.org
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. mobile.walmart.com supports three categories of devices using the same Java code (only the html is (very) different.) Try doing that with JSP. ā€” Joachim Kainz
  • 26. ... We at Vegas.com have been able to re- purpose our Wicket-based air/hotel search application and purchase/checkout application. This is the new mexico.com. [...] The re-use of components and abstract pages was tremendous. ā€”Scott Swank, chief architect vegas.com
  • 28. Sign up form Example from Railscast episode #250
  • 30. Sign up form <h1>Sign Up</h1> <form> <div class="error_messages"> <h2>Form is invalid</h2> <ul> <li>Some error message</li> </ul> </div> <p> <label for="email">E-Mail</label><br/> <input type="email" id="email" /> </p> <p> <label for="password">Password</label> <input type="password" id="password" /> </p> <p> <label for="conļ¬rm">Password conļ¬rmat <input type="password" id="conļ¬rm" /> </p> <p class="button"><input type="submit" va
  • 32. Sign up form <h1>SignĀ Up</h1>Ā Ā  Ā Ā  <%=Ā form_forĀ @userĀ doĀ |f|Ā %>Ā Ā  Ā Ā <%Ā ifĀ @user.errors.any?Ā %>Ā Ā  Ā Ā Ā Ā <divĀ class="error_messages">Ā Ā  Ā Ā Ā Ā Ā Ā <h2>FormĀ isĀ invalid</h2>Ā Ā  Ā Ā Ā Ā Ā Ā <ul>Ā Ā  Ā Ā Ā Ā Ā Ā Ā Ā <%Ā forĀ messageĀ inĀ @user.errors.fullĀ Ā  Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā <li><%=Ā messageĀ %></li>Ā Ā  Ā Ā Ā Ā Ā Ā Ā Ā <%Ā endĀ %>Ā Ā  Ā Ā Ā Ā Ā Ā </ul>Ā Ā  Ā Ā Ā Ā </div>Ā Ā  Ā Ā <%Ā endĀ %>Ā Ā  Ā Ā <p>Ā Ā  Ā Ā Ā Ā <%=Ā f.labelĀ :emailĀ %><brĀ />Ā Ā  Ā Ā Ā Ā <%=Ā f.text_ļ¬eldĀ :emailĀ %>Ā Ā  Ā Ā </p>Ā Ā  Ā Ā <p>Ā Ā  Ā Ā Ā Ā <%=Ā f.labelĀ :passwordĀ %><brĀ />Ā Ā  Ā Ā Ā Ā <%=Ā f.password_ļ¬eldĀ :passwordĀ %>Ā Ā  Ā Ā </p>Ā Ā  Ā Ā <p>
  • 33. Sign up form <h1>Sign Up</h1> <form> <div class="error_messages"> <h2>Form is invalid</h2> <ul> <li>Some error message</li> </ul> </div> <p> <label for="email">E-Mail</label><br/> <input type="email" id="email" /> </p> <p> <label for="password">Password</label> <input type="password" id="password" /> </p> <p> <label for="conļ¬rm">Password conļ¬rmat <input type="password" id="conļ¬rm" /> </p> <p class="button"><input type="submit" va
  • 34. Sign up form <h1>Sign Up</h1> <form> <div wicket:id="feedback" class="error_me <h2>Form is invalid</h2> <ul> <li>Some error message</li> </ul> </div> <p> <label for="email">E-Mail</label><br/> <input wicket:id="email" type="email" i </p> <p> <label for="password">Password</label> <input wicket:id="password" type="passw </p> <p> <label for="conļ¬rm">Password conļ¬rmat <input wicket:id="conļ¬rm" type="passwo </p> <p class="button"><input type="submit" va
  • 35. Sign up form <h1>Sign Up</h1> <form> <div wicket:id="feedback" class="error_me <h2>Form is invalid</h2> <ul> <li>Some error message</li> </ul> </div> <p> <label for="email">E-Mail</label><br/> <input wicket:id="email" type="email" i </p> <p> <label for="password">Password</label> <input wicket:id="password" type="passw </p> <p> <label for="conļ¬rm">Password conļ¬rmat <input wicket:id="conļ¬rm" type="passwo </p> <p class="button"><input type="submit" va
  • 37. Imperative markup <h1>SignĀ Up</h1> ā€¢ Used by Ruby on Rails, <%=Ā form_forĀ @userĀ doĀ |f|Ā %> Ā Ā <%Ā ifĀ @user.errors.any?Ā %> JSP, Play, Velocity, ... Ā Ā Ā Ā <divĀ class="error_messag Ā Ā Ā Ā Ā Ā <h2>FormĀ isĀ invalid</h ā€¢ Ā Ā Ā Ā Ā Ā <ul> Great for web developers Ā Ā Ā Ā Ā Ā Ā Ā <%Ā forĀ messageĀ inĀ @u Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā <li><%=Ā messageĀ %> ā€¢ Great for hacking on a Ā Ā Ā Ā Ā Ā Ā Ā <%Ā endĀ %> Ā Ā Ā Ā Ā Ā </ul> web site Ā Ā Ā Ā </div> Ā Ā <%Ā endĀ %> Ā Ā <p> ā€¢ Code and markup are Ā Ā Ā Ā <%=Ā f.labelĀ :emailĀ %><br Ā Ā Ā Ā <%=Ā f.text_ļ¬eldĀ :emailĀ  not separated Ā Ā </p> Ā Ā <p>
  • 38. Declarative markup <h1>Sign Up</h1> ā€¢ Used by Wicket, Tapestry, <form wicket:id="form"> <div class="error_message Facelets <p> <label for="email">E-Ma ā€¢ Great for web designers <input type="email" id= </p> <p> ā€¢ Go from PSD ā†’ HTML ā†’ <label for="password">P <input type="password" Page ā†’ Component </p> <p> <label for="conļ¬rm">Pa ā€¢ Code and markup are <input type="password" </p> strictly separated <p class="button"><input </form>
  • 40. Sign up form <h1>SignĀ Up</h1>Ā Ā  Ā Ā  <%=Ā form_forĀ @userĀ doĀ |f|Ā %>Ā Ā  Ā Ā <%Ā ifĀ @user.errors.any?Ā %>Ā Ā  Ā Ā Ā Ā <divĀ class="error_messages">Ā Ā  Ā Ā Ā Ā Ā Ā <h2>FormĀ isĀ invalid</h2>Ā Ā  Ā Ā Ā Ā Ā Ā <ul>Ā Ā  Ā Ā Ā Ā Ā Ā Ā Ā <%Ā forĀ messageĀ inĀ @user.errors.full_messagesĀ %>Ā Ā  Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā <li><%=Ā messageĀ %></li>Ā Ā  Ā Ā Ā Ā Ā Ā Ā Ā <%Ā endĀ %>Ā Ā  Ā Ā Ā Ā Ā Ā </ul>Ā Ā  Ā Ā Ā Ā </div>Ā Ā  Ā Ā <%Ā endĀ %>Ā Ā  Ā Ā <p>Ā Ā  Ā Ā Ā Ā <%=Ā f.labelĀ :emailĀ %><brĀ />Ā Ā  Ā Ā Ā Ā <%=Ā f.text_ļ¬eldĀ :emailĀ %>Ā Ā  Ā Ā </p>Ā Ā  Ā Ā <p>Ā Ā  Ā Ā Ā Ā <%=Ā f.labelĀ :passwordĀ %><brĀ />Ā Ā  Ā Ā Ā Ā <%=Ā f.password_ļ¬eldĀ :passwordĀ %>Ā Ā  Ā Ā </p>Ā Ā  Ā Ā <p>Ā Ā  Ā Ā Ā Ā <%=Ā f.labelĀ :password_conļ¬rmationĀ %>Ā Ā 
  • 41. Sign up form Form form = new Form("signup") { @Override public void onSubmit() { // ... } } add(form);
  • 42. Sign up form Form form = new Form("signup") { @Override public void onSubmit() { // ... } } add(form); FeedbackPanel feedback = new FeedbackPanel("feedback"); feedback.setVisible(form.hasFeedbackMessages()); form.add(feedback);
  • 43. Sign up form Form form = new Form("signup") { @Override public void onSubmit() { // ... } } add(form); FeedbackPanel feedback = new FeedbackPanel("feedback"); feedback.setVisible(form.hasFeedbackMessages()); form.add(feedback); form.add(new EmailTextField("email", Model.of("")) .setRequired(true));
  • 44. Sign up form Form form = new Form("signup") { @Override public void onSubmit() { // ... } } add(form); FeedbackPanel feedback = new FeedbackPanel("feedback"); feedback.setVisible(form.hasFeedbackMessages()); form.add(feedback); form.add(new EmailTextField("email", Model.of("")) .setRequired(true)); form.add(new PasswordField("password", Model.of("")) .setRequired(true));
  • 45. Sign up form Form form = new Form("signup") { @Override public void onSubmit() { // ... } } add(form); FeedbackPanel feedback = new FeedbackPanel("feedback"); feedback.setVisible(form.hasFeedbackMessages()); form.add(feedback); form.add(new EmailTextField("email", Model.of("")) .setRequired(true)); form.add(new PasswordField("password", Model.of("")) .setRequired(true)); form.add(new PasswordField("conļ¬rm", Model.of("")) .setRequired(true));
  • 46. Just Java ā€¢ No logic in markup ā€¢ Components are objects (use new and extends) ā€¢ Use OO techniques in your programming ā€¢ No XML
  • 48. Components ā€¢ Manipulate markup ā€¢ Render content ā€¢ Receive events (onClick, onSubmit) ā€¢ Examples: Label, Link, Form, TextField, PagingNavigator, Panel, Page, ClientSideImageMap
  • 49. Models ā€¢ Provide data to components ā€¢ Store data for components ā€¢ Transform data ā€¢ Retrieve data from persistent storage ā€¢ Examples: Model<T>, PropertyModel<T>
  • 50. Behaviors ā€¢ Decorator/Adapter for Component ā€¢ Can manipulate markup of Component ā€¢ Can receive events (onClick) ā€¢ Add Ajax functionality to components ā€¢ Example: AjaxSelfUpdatingTimerBehavior
  • 52. Wicket projects ā€¢ Apache Wicket ā€¢ Leg before Wicket (extensions, spring, guice, velocity, etc) (Maven archetypes) ā€¢ Wicket stuff ā€¢ Apache Isis (grand collection of projects) (incubating, DDD framework) ā€¢ Seam for Apache ā€¢ Jolira Tools Wicket (powers mobile.walmart.com) ā€¢ WiQuery ā€¢ Visural Wicket (standalone Wicket components) (JQuery integration library)
  • 53. Apache Wicket projects ā€¢ Core ā€¢ Velocity ā€¢ Extensions ā€¢ Auth/Roles ā€¢ Quick start ā€¢ JMX ā€¢ IoC ā€¢ Dev utils ā€¢ Spring ā€¢ Guice ā€¢ Examples ā€¢ DateTime
  • 54. Wicket Stuff projects ā€¢ progressbar ā€¢ shiro-security ā€¢ theme ā€¢ datatable-autocomplete ā€¢ gae-initializer ā€¢ yav ā€¢ ļ¬‚ot ā€¢ push-jdk-1.5 ā€¢ maven-support ā€¢ googlecharts ā€¢ jasperreports ā€¢ plugin ā€¢ scala-extensions ā€¢ mbeanview ā€¢ input-events ā€¢ openlayers ā€¢ jsr303 ā€¢ javaee-inject ā€¢ gmap2 ā€¢ client-and-server-validation ā€¢ push ā€¢ inmethod-grid ā€¢ multi-text-input ā€¢ wicket-html5 ā€¢ minis ā€¢ prototype ā€¢ wicket-servlet3 ā€¢ phonebook ā€¢ simile-timeline
  • 58. Running quickstart $ mvn -o archetype:generate -DarchetypeGroupId=org.apache.wicket - DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.5- SNAPSHOT -DgroupId=com.mycompany -DartifactId=myproject - DarchetypeRepository=https://repository.apache.org/content/repositories/ snapshots/ -DinteractiveMode=false _
  • 59. Running quickstart $ mvn -o archetype:generate -DarchetypeGroupId=org.apache.wicket - DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.5- SNAPSHOT -DgroupId=com.mycompany -DartifactId=myproject - DarchetypeRepository=https://repository.apache.org/content/repositories/ snapshots/ -DinteractiveMode=false [INFO] Scanning for projects... [INFO] ----------------------------------------------------------- [INFO] Building Maven Stub Project (No POM) 1 [INFO] ----------------------------------------------------------- [INFO] >>> maven-archetype-plugin:2.0:generate (default-cli) >>> [INFO] <<< maven-archetype-plugin:2.0:generate (default-cli) <<< [INFO] --- maven-archetype-plugin:2.0:generate (default-cli) --- [INFO] Generating project in Batch mode [INFO] Archetype deļ¬ned by properties [INFO] ----------------------------------------------------------- [INFO] BUILD SUCCESS [INFO] ----------------------------------------------------------- [INFO] Total time: 1.279s [INFO] Finished at: Fri Feb 04 22:04:14 CET 2011 [INFO] Final Memory: 9M/81M [INFO] -----------------------------------------------------------
  • 61. Running quickstart $ mvn jetty:run [INFO] Scanning for projects... [INFO] ----------------------------------------------------------- [INFO] Building quickstart 1.0-SNAPSHOT [INFO] ----------------------------------------------------------- [INFO] Starting jetty 7.2.2.v20101205 ... 2011-02-04 22:04:34.969:INFO::jetty-7.2.2.v20101205 2011-02-04 22:04:35.198:INFO::No Transaction manager found - if yo INFO - WebXmlFile - web.xml: found ļ¬lter with na INFO - Application - [wicket.myproject] init: Wick INFO - RequestListenerInterface - registered listener interface INFO - WebApplication - [wicket.myproject] Started Wi ****************************************************************** *** WARNING: Wicket is running in DEVELOPMENT mode. *** *** ^^^^^^^^^^^ *** *** Do NOT deploy to your live server(s) without changing this.*** *** See Application#getConļ¬gurationType() for more information*** ****************************************************************** 2011-02-04 22:04:35.464:INFO::Started SelectChannelConnector@0.0.0.0:8080 [INFO] Started Jetty Server
  • 63. Quick start alternative Leg up ā€¢ Spring ā€¢ Guice ā€¢ JDBC ā€¢ JPA ā€¢ Hibernate ā€¢ Scala http://jweekend.com/dev/LegUp
  • 64. Want to learn more?
  • 65. Want to learn more?
  • 66. Want to learn more? http://wicket.apache.org/learn/books.html
  • 72. Hello, World! <h1 wicket:id="msg">[Replaced text]</h1> + add(new Label("msg", "Hello, World!"));
  • 73. Hello, World! <h1 wicket:id="msg">[Replaced text]</h1> + add(new Label("msg", "Hello, World!")); = <h1>Hello, World!</h1>
  • 75. This link has been clicked 123 times
  • 76. This link has been clicked 123 times This link has been clicked 123 times!
  • 77. This link has been clicked 123 times This <a href="#">link</a> has been clicked 123 times!
  • 78. This link has been clicked 123 times This <a href="#">link</a> has been clicked <span>123</span> times!
  • 79. This link has been clicked 123 times This <a wicket:id="link" href="#">link</a> has been clicked <span>123</span> times!
  • 80. This link has been clicked 123 times This <a wicket:id="link" href="#">link</a> has been clicked <span wicket:id="clicks">123</span> times!
  • 81. This link has been clicked 123 times This <a wicket:id="link" href="#">link</a> has been clicked <span wicket:id="clicks">123</span> times!
  • 82. This link has been clicked 123 times public class ClickCountPage extends WebPage { }
  • 83. This link has been clicked 123 times public class ClickCountPage extends WebPage { public ClickCountPage() { } }
  • 84. This link has been clicked 123 times public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCountPage() { } }
  • 85. This link has been clicked 123 times public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCountPage() { add(new Link<Void>("link") { public void onClick() { clicks++; } }); }
  • 86. This link has been clicked 123 times public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCountPage() { add(new Link<Void>("link") { ... }); add(new Label("clicks", new PropertyModel<Integer>(this, "clicks"))); } }
  • 88. 2 modes for your app Development and Deployment
  • 89. Development mode $ mvn jetty:run [INFO] Scanning for projects... [INFO] ----------------------------------------------------------- [INFO] Building quickstart 1.0-SNAPSHOT [INFO] ----------------------------------------------------------- [INFO] Starting jetty 7.2.2.v20101205 ... 2011-02-04 22:04:34.969:INFO::jetty-7.2.2.v20101205 2011-02-04 22:04:35.198:INFO::No Transaction manager found - if yo INFO - WebXmlFile - web.xml: found ļ¬lter with na INFO - Application - [wicket.myproject] init: Wick INFO - RequestListenerInterface - registered listener interface INFO - WebApplication - [wicket.myproject] Started Wi ****************************************************************** *** WARNING: Wicket is running in DEVELOPMENT mode. ** *** ^^^^^^^^^^^ ** *** Do NOT deploy to your live server(s) without changing this. ** *** See Application#getConļ¬gurationType() for more information ** ****************************************************************** 2011-02-04 22:04:35.464:INFO::Started SelectChannelConnector@0.0.0.0:8080 [INFO] Started Jetty Server
  • 90. Development mode ā€¢ exceptional error pages ā€¢ dynamic markup reloading ā€¢ no caching ā€¢ no javascript/css optimizations ā€¢ discover mistakes early (serialization, missing components, ...) ā€¢ Wicket debugger visible
  • 91. Deployment mode ā€¢ Cache markup resources ā€¢ No checks ā€¢ Donā€™t display stack traces to users ā€¢ Minimize/compress JavaScript ā€¢ Donā€™t generate wicket tags ā€¢ Wicket debugger not visible
  • 92. FREE PRO TIP: Donā€™t perform your performance tests in development mode!
  • 95. Ajax envelope <?xml version="1.0" encoding="UTF-8"?> <ajax-response> <component id="count2"> <![CDATA[<span wicket:id="count" id="count2">1</span>]]> </component> </ajax-response>
  • 96. Error message Unable to ļ¬nd component with id 'count' in HomePage. This means that you declared wicket:id=count in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match.
  • 99. WicketTester ā€¢ Test components directly, or their markup ā€¢ Runs tests without starting server ā€¢ Ajax testing (server side) ā€¢ Runs in IDE, ant, maven builds ā€¢ Achieves high code coverage
  • 100. Testing Hello, World! @Test public void rendersWelcomeMessage() { }
  • 101. Testing Hello, World! @Test public void rendersWelcomeMessage() { WicketTester tester = new WicketTester(); }
  • 102. Testing Hello, World! @Test public void rendersWelcomeMessage() { WicketTester tester = new WicketTester(); tester.startPage(HelloWorldPage.class); }
  • 103. Testing Hello, World! @Test public void rendersWelcomeMessage() { WicketTester tester = new WicketTester(); tester.startPage(HelloWorldPage.class); tester.assertLabel("msg", "Hello, World!"); }
  • 104. Testing Click Count @Test public void clicksIncreaseCount() { }
  • 105. Testing Click Count @Test public void clicksIncreaseCount() { WicketTester tester = new WicketTester(); }
  • 106. Testing Click Count @Test public void clicksIncreaseCount() { WicketTester tester = new WicketTester(); tester.startPage(ClickCountPage.class); }
  • 107. Testing Click Count @Test public void clicksIncreaseCount() { WicketTester tester = new WicketTester(); tester.startPage(ClickCountPage.class); tester.assertModelValue("clicks", 0); }
  • 108. Testing Click Count @Test public void clicksIncreaseCount() { WicketTester tester = new WicketTester(); tester.startPage(ClickCountPage.class); tester.assertModelValue("clicks", 0); tester.clickLink("link"); }
  • 109. Testing Click Count @Test public void clicksIncreaseCount() { WicketTester tester = new WicketTester(); tester.startPage(ClickCountPage.class); tester.assertModelValue("clicks", 0); tester.clickLink("link"); tester.assertModelValue("clicks", 1); }
  • 110. Other test frameworks ā€¢ PageTest (by Kent Tong) ā€¢ JDave (BDD framework)
  • 111. Summary ā€¢ Widely used ā€¢ Component oriented ā€¢ Java ā€¢ Open Source (ASL 2.0)
  • 114. Pre 1.5 ā€¢ Checks for valid markup donā€™t accept new ļ¬eld types ā€¢ HTML 5 deļ¬nes: <input type=ā€text|email|password|number|date| search|url|...ā€>
  • 115. Wicket 1.5 ā€¢ EmailTextField ā€¢ NumberTextField ā€¢ UrlTextField ā€¢ RangeTextField
  • 117. Split up core library ā€¢ Old: ā€¢ wicket.jar
  • 118. Split up core library ā€¢ Old: ā€¢ wicket.jar ā€¢ New: ā€¢ wicket-requests.jar ā€¢ wicket-util.jar ā€¢ wicket-core.jar
  • 119. Maven users <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-core</artifactId> <version>1.5-RC1</version> </dependency>
  • 121. Wicket < 1.5 ā€¢ Decoding request and handling in state machine ā€¢ Debugging ā€˜interestingā€™ ā€¢ Designed for ļ¬‚exibility ā€¢ Served its purposeā€”took on 4 years of engineering
  • 122. Wicket 1.5 ā€¢ Request cycle processing completely rewritten ā€¢ Rendering code has been improved and simpliļ¬ed ā€¢ URL rendering simpliļ¬ed: now in one place
  • 123. Wicket < 1.5 ā€¢ Custom request cycle: subclass WebRequestCycle ā€¢ Problematic with add-ons: ā€¢ HibernateRequestCycle ā€¢ SecureRequestCycle ā€¢ ActivityRequestCycle
  • 124. New: RequestCycleListener public interface IRequestCycleListener { void onBeginRequest(RequestCycle cycle); void onEndRequest(RequestCycle cycle); void onDetach(RequestCycle cycle); IRequestHandler onException(RequestCycle cycle, Exception ex); }
  • 125. RequestCycleListener public class SomeWebApplication extends WebApplication { @Override protected void init() { } @Override public Class<? extends Page> getHomePage() { return SomePage.class; } }
  • 126. RequestCycleListener public class SomeWebApplication extends WebApplication { @Override protected void init() { addRequestCycleListener(new IRequestCycleListener() { public void onBeginRequest() { // do something at the beginning of the request } public void onEndRequest() { // do something at the end of the request } public void onException(Exception ex) { // do something here when there's an exception } }); } @Override public Class<? extends Page> getHomePage() { return SomePage.class; } }
  • 128. Switching to HTTPS public SecurePage extends WebPage { ... } public MyApplications extends WebApplication { @Override public void init() { super.init(); } }
  • 129. Switching to HTTPS @RequireHttps public SecurePage extends WebPage { ... } public MyApplications extends WebApplication { @Override public void init() { super.init(); } }
  • 130. Switching to HTTPS @RequireHttps public SecurePage extends WebPage { ... } public MyApplications extends WebApplication { @Override public void init() { super.init(); setRootRequestMapper( new HttpsMapper(getRootRequestMapper(), new HttpsConļ¬g()); } }
  • 132. Component event bus ā€¢ IEventSource: objects that send events <T> void send(IEventSink sink, Broadcast broadcast, T payload); ā€¢ IEventSink: objects that receive events void onEvent(IEvent<?> event); ā€¢ Participants: Components, RequestCycle, Session and Application
  • 133. Event bus example Ajax link counter
  • 134. This link has been clicked 123 times public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new Link<Void>("link") { @Override public void onClick() { count++; } }); add(new Label("clicks", new PropertyModel<Integer>(this, "clicks"))); } }
  • 135. This link has been clicked 123 times public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new Link<Void>("link") { @Override public void onClick() { count++; } }); add(new Label("clicks", new PropertyModel<Integer>(this, "clicks")) .setOutputMarkupId(true)); } }
  • 136. This link has been clicked 123 times public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { @Override public void onClick(AjaxRequestTarget target) { count++; } }); add(new Label("clicks", new PropertyModel<Integer>(this, "clicks")) .setOutputMarkupId(true)); } }
  • 137. This link has been clicked 123 times public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { @Override public void onClick(AjaxRequestTarget target) { count++; target.add(getPage().get("count")); } }); add(new Label("count", new PropertyModel<Integer>(this, "clicks")) .setOutputMarkupId(true)); } }
  • 138. This link has been clicked 123 times public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { @Override public void onClick(AjaxRequestTarget target) { count++; target.add(getPage().get("count")); } }); add(new Label("count", new PropertyModel<Integer>(this, "clicks")) .setOutputMarkupId(true)); } }
  • 139. Pre-event bus ā€¢ Link needs to know the updatable components ā€¢ Makes code brittle, hard to maintain ā€¢ Better: ā€¢ Let the label refresh itself with each Ajax request
  • 140. public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { @Override public void onClick(AjaxRequestTarget target) { count++; target.add(getPage().get("count")); } }); add(new Label("count", new PropertyModel<Integer>(this, "clicks")) .setOutputMarkupId(true)); } }
  • 141. public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { @Override public void onClick(AjaxRequestTarget target) { count++; send(getPage(), Broadcast.BREADTH, target); } }); add(new Label("count", new PropertyModel<Integer>(this, "clicks")) .setOutputMarkupId(true)); } }
  • 142. public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { @Override public void onClick(AjaxRequestTarget target) { count++; send(getPage(), Broadcast.BREADTH, target); } }); add(new CountLabel("count", new PropertyModel<Integer>(this, } }
  • 143. public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { ... }); add(new CountLabel("count", new PropertyModel<Integer>(this, } public class CountLabel extends Label { } }
  • 144. public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { ... }); add(new CountLabel("count", new PropertyModel<Integer>(this, } public class CountLabel extends Label { public CountLabel(String id, IModel<Integer> model) { super(id, model); } } }
  • 145. public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { ... }); add(new CountLabel("count", new PropertyModel<Integer>(this, } public class CountLabel extends Label { public CountLabel(String id, IModel<Integer> model) { super(id, model); setOutputMarkupId(true); } } }
  • 146. public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { ... }); add(new CountLabel("count", new PropertyModel<Integer>(this, } public class CountLabel extends Label { public CountLabel(String id, IModel<Integer> model) { super(id, model); setOutputMarkupId(true); } @Override public void onEvent(IEvent<?> event) { super.onEvent(event); } } }
  • 147. public class ClickCountPage extends WebPage { private int clicks = 0; public ClickCount() { add(new AjaxLink<Void>("link") { ... }); add(new CountLabel("count", new PropertyModel<Integer>(this, } public class CountLabel extends Label { public CountLabel(String id, IModel<Integer> model) { super(id, model); setOutputMarkupId(true); } @Override public void onEvent(IEvent<?> event) { super.onEvent(event); if (event.getPayload() instanceof AjaxRequestTarget) { AjaxRequestTarget target = (AjaxRequestTarget) event.getPayload(); target.add(this); } } } }
  • 148. Post-event bus ā€¢ A bit more code ā€¢ Updates are now completely decoupled ā€¢ Make the payload type safe and meaningful: no AjaxRequestTarget, but CountEvent ā€¢ AJAX requests trigger a default event with an AjaxRequestTarget as payload
  • 149. And much, much more: http://cwiki.apache.org/WICKET/ migration-to-wicket15.html
  • 150. Thank you! Questions? Ask!

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. refresher course voor Wicket\n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. quickstart, leg before wicket, projecten en boeken\n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. - debug mode voor quick turnaround\n - jrebel\n - markup reloading\n - markup/js/css in package structuur\n - development mode: excellente excepties, andere tools voor ontwikkelaars\n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. - wicket tester\n - jdave\n - page test (kent tong?)\n - cucumber wicket\n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n