SlideShare a Scribd company logo
Apache Wicket 
                            Deliver your web 
                           application on time
                                         Yoav Hakman
                                     Development Manager 
                                     & Consultant, AlphaCSP

                                                              2
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Agenda

         Overview

         The Wicket Way (Concepts)

         Features

         Demo
                A wicket application
                A custom component

         Q & A

                                                        3
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
From Roi’s JSF presentation:

          JSF 1.2 (JSR 252):
            Shortcomings 
                    Development
                           Customizing components is complicated
                           Exceptions are not descriptive
                           No support for annotations
                    Deployment
                           Unnecessary deployment step
                           Not JEE compliant (packaging, DI)
                    Components
                           Missing components
                           Limited component functionality (DataGrid)
                    Security
                           No security model (managed beans, resources)
                    Ajax
                                                                           4
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Overview
        • Component based Java web framework
               • rich component suite
        • Open source (Apache 2 Licensed)
        • Wicket makes developing web­apps simple and 
          enjoyable again
                    Flat learning curve
               •
                    No XML configuration files
               •
                    Very easy to create and reuse components!
               •
                    Pure Object Oriented!
               •



                                                                5
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
A little bit of history


                                                         1.2
          0.9                 1.0                 1.1                         1.3




   10/2004                                   10/2005              07/2007

                       06/2005                          05/2006             11/2007




                                                                                      6
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Good Documentation




        Wicket wiki:
               http://cwiki.apache.org/WICKET/


        Wicket Examples (Live Demo + sources):
               http://www.wicketstuff.org/wicket13/
                                                        7
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
From Roi’s JSF presentation:
         JSF 2.0 (JSR 314):
         Purpose
                    Max. development productivity (IDE)
               
                    Min. maintenance complexity
               
                    Integrate with other web tech.
               
                    More responsive UI (Ajax)
               
         Requirements
                    Ease of development
               
                    New Features & Fixes
               
                    Performance & Scalability
               
                    Technology Adoption
               
                                                          8
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Agenda

         Overview

         The Wicket Way (Concepts)

         Features

         Demo
                A wicket application
                A custom component

         Q & A

                                                        9
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Wicket Templates

        • HTML Templates contains 
               • static presentation code (markup)
               • wicket:id  attribute­ placeholder for wicket 
                 components

        • Forces the developer to keep “clean templates”

        • The html designer has no knowledge regarding 
          the business domain objects
               • vs jsf backing bean


                                                                 10
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Templates
                          <table> 
    JSP:                     <tr> 
                              <c:forEach var=quot;itemquot; items=quot;${sessionScope.list}quot;> 
                                <td> 
                                  <c:out value=quot;item.namequot; /> 
                                </td> 
                              </c:forEach> 
                            </tr> 
                          </table> 

                                 <h:dataTable value=quot;#{list}quot; var=quot;itemquot;> 
    JSF:                             <h:column> 
                                         <h:outputText value=quot;#{item.name}quot;/> 
                                     </h:column> 
                                 </h:dataTable> 
                                                                                         
                                    <table> 
                                      <tr> 
    WICKET:                             <td wicket:id=”list”> 
                                           <span wicket:id=”name”>power point</span> 
                                        </td> 
                                      </tr> 
                                    </table> 
                                                                         
                                                                                            11
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Wicket Templates

        • Most existing frameworks require special 
          HTML code.
        • fully compliant with the XHTML standard, 
          so you can use:
                      • Macromedia Dreamweaver
                      • Microsoft Front Page
                      • Any other HTML editor




                                                        12
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
If you know Java and HTML you already know a 
                       lot about Wicket!!




                                                        13
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Linking Java and HTML

        public class HelloWorld extends WebPage { 
         
            public HelloWorld() { 
                add(new Label(quot;messagequot;, quot;Hello World!quot;)); 
            } 
        } 


                                   Identifier           Model


    <html> 
    <body> 
        <span wicket:id=quot;messagequot; id=quot;messagequot;>to be replaced</span> 
    </body> 
    </html> 
     

                                                                        14
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Linking Java and HTML

               HTML and Java files resides in the same 
                classpath package




                                                          15
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Object Oriented

           • Object Oriented
               • Great for Java developers 
               • Everything is done in Java
               • Swing like programming …

       Form form = new Form(quot;customerformquot;,  
                             new CompoundPropertyModel(new Customer())); 
       TextField zipCodeComponent = new TextField(quot;zipquot;); 
       zipCodeComponent.add(new ZipCodeValidator()); 
       form.add(zipCodeComponent); 
        




                                                                            16
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Application Class
      public class DemoApplication extends WebApplication { 
       
          @Override public Class getHomePage() { 
              return HomePage.class; 
          } 
       
          @Override protected void init() { 
              getMarkupSettings().setCompressWhitespace(false); 
          } 
                                                                    
        • Settings
                    Application Settings
               –
                    Debug Settings
               –
                    Exception Settings
               –
                    Markup Settings
               –
                    Page Settings
               –
                    RequestCycle Settings
               –
                    Security Settings
               –
                    Session Settings
               –
                                                                       18
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Application Class

        • The only xml configuration is the web.xml configuration!



    <filter> 
        <filter­name>DemoApplication</filter­name> 
        <filter­class>org.apache.wicket.protocol.http.WicketFilter</filter­ 
        <init­param> 
            <param­name>applicationClassName</param­name> 
            <param­value>com.alphacsp.DemoApplication</param­value> 
        </init­param> 
        <init­param> 
            <param­name>configuration</param­name> 
            <param­value>development</param­value> 
            <!­­ <param­value>deployment</param­value> ­­> 
        </init­param> 
    </filter> 
                                                                           
                                                                              19
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
From Roi’s JSF presentation:

          JSF 1.2 (JSR 252):
            Shortcomings 
                    Development
                           Customizing components is complicated
                       Exceptions are not descriptive
                       No support for annotations
                    Deployment
                       Unnecessary deployment step
                       Not JEE compliant (packaging, DI)
                    Components
                       Missing components
                       Limited component functionality (DataGrid)
                    Security
                       No security model (managed beans, resources)

                                                                       20
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Customizing Components

            • Object Oriented Basics – how to extend:
                   • By Inheritance
                   • By Delegation
        public class PasswordTextField extends TextField { 
         
            public PasswordTextField(String id) { 
                super(id); 
            } 
         
            /** 
             * Processes the component tag 
             */   
            protected final void onComponentTag(final ComponentTag tag) { 
                super.onComponentTag(tag); 
                tag.put(quot;valuequot;, quot;quot;); 
            } 
         
        } 
                                                                              
                                                                             21
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Customizing Components

     Component Hook Methods
public class MyComponent extends Component { 
 
    protected void onAfterRender() { 
    } 
 
    protected void onBeforeRender() { 
    } 
 
    protected void onComponentTag(ComponentTag tag) { 
    } 
 
    protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) 
    } 
 
    protected void onModelChanged() { 
    } 
 
    protected void onRender(MarkupStream markupStream) { 
         
    } 
} 

                                                                                  22
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Customizing Components

            • Object Oriented Basics – how to extend:
                   • By Inheritance
                   • By Delegation




                                                        23
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Customizing Components

    public class SimpleAttributeModifier extends AbstractBehavior { 
        /** 
         * Called any time a component that has this behavior registered is  
         * rendering the component tag. 
         */ 
        public void onComponentTag(final Component component,  
                                   final ComponentTag tag) 
            { 
                   if (isEnabled(component)) 
                   { 
                           tag.getAttributes().put(attribute, value); 
                   } 
            } 
     
                                                                                 




                                                                            24
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Customizing Components

        SimpleAttributeModifer
    TextField myText = new TextField(quot;myTextquot;, new Model(quot;fooquot;)); 
    myText.add(new SimpleAttributeModifier(quot;classquot;, quot;greenquot;)); 
                                                                          
    With the following markup: 
     
    <input type=quot;textquot; wicket:id=quot;myTextquot;/> 
     
    Would be rendered as: 
     
    <input type=”text” wicket:id=”myText” name=”myText” class=”green” 
           value=”foo”/> 
     

                                                                             25
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Customizing Components

  item.add(new AbstractBehavior() { 
    /** 
     * Called any time a component that has this behavior registered is  
     * rendering the component tag. 
     */ 
    public void onComponentTag(Component component, ComponentTag tag) { 
      String css = (((Item) component).getIndex() % 2 == 0) ? quot;evenquot;:quot;oddquot;; 
      tag.put(quot;classquot;, css); 
    } 
  }); 
   
      Output:
      <tr class=“odd”>…</tr> 
      <tr class=“even”>…</tr> 
                                                         




                                                                         26
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Customizing Components

              • Behaviors are used for:
                             • Modifying attributes
                             • Adding Java Script events
                             • Adding Ajax Events



   TextField field = new TextField(quot;textfieldquot;, inputModel); 
   add(field); 
    
   field.add(new AjaxFormComponentUpdatingBehavior(quot;onblurquot;) { 
       protected void onUpdate(AjaxRequestTarget target) { 
       // do something here 
       } 
   }); 
                                                                   
                                                                      27
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Agenda

         Overview

         The Wicket Way (Concepts)

         Features

         Demo
                A wicket application
                A custom component

         Q & A

                                                        28
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
From Roi’s JSF presentation:

          JSF 1.2 (JSR 252):
            Shortcomings 
                    Development
                       Customizing components is complicated
                       Exceptions are not descriptive
                       No support for annotations
                    Deployment
                       Unnecessary deployment step
                       Not JEE compliant (packaging, DI)

                    Components
                           Missing components
                           Limited component functionality (DataGrid)
                       Security
                   
                          No security model (managed beans, resources)



                                                                          29
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Editable table




                                                        30
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Table




                                                        31
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Editable Tree Table




                                                        32
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
DatePicker




                                                        33
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Captcha




                                                        34
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Modal Window




                                                        35
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
File Upload




                                                        36
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Tabbed Panel



   <span wicket:id=quot;tabsquot;  
      class=quot;tabpanelquot;>[tabbed panel]</span> 
                                              List<ITab> tabs = new ArrayList<ITab>(); 
                                              tabs.add(new AbstractTab(new Model(quot;first tabquot;)) { 
                                                  public Panel getPanel(String panelId) { 
                                                      return new TabPanel1(panelId); 
                                                  } 
                                              }); 
                                              tabs.add(new AbstractTab(new Model(quot;second tabquot;)) { 
                                                  public Panel getPanel(String panelId) { 
                                                      return new TabPanel2(panelId); 
                                                  } 
                                              }); 
                                              tabs.add(new AbstractTab(new Model(quot;third tabquot;)) { 
                                                  public Panel getPanel(String panelId) { 
                                                      return new TabPanel3(panelId); 
                                                  } 
                                              }); 
                                                                                                     37
                                              add(new TabbedPanel(quot;tabsquot;, tabs)); 
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Auto Complete Component




                                                        38
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Models

     • Holds the values of the components
     • Mediate between the view and domain 
       layer



                                                            public interface IModel { 
                                                         
                                                                Object getObject(); 
                                                         
                                                                void setObject(Object object); 
                                                         
                                                            } 
                                                                                                   
                                                                                                      39
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Models
      public class HelloWorld extends WebPage { 
       
          public HelloWorld() { 
              add(new Label(quot;messagequot;, quot;Hello World!quot;)); 
          } 
      } 
                                                                       
      public class HelloWorld extends WebPage { 
       
          public HelloWorld() { 
              add(new Label(quot;messagequot;, new Model(quot;Hello World!quot;)); 
          } 
      } 
                                                                       
                                                                       
                   The data is constant 

                                                                          40
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Models

 public class HelloWorld extends WebPage { 
  
     public HelloWorld() { 
         add(new TextField(quot;namequot;, new Model(person.getName())); 
     } 
 } 
                                                                      
                                                                      
        • Immutable, not dynamic
        • Can produce null pointer exceptions!
               person.getAddress().getCity()



                                                                    41
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Models

    personForm.add(new TextField(quot;personNamequot;, new IModel() { 
                public Object getObject() { 
                    return person.getName(); 
                } 
     
                public void setObject(Serializable serializable) { 
                    person.setName((String) serializable); 
                } 
            })); 

     
        • Dynamic
        • Inconvenient!


                                                                      42
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Models

     new TextField(quot;personNamequot;, new PropertyModel(person, quot;namequot;)); 

                                                                         
        • The expression language is more compact 
          than the analogous Java code 
        • Simpler than to subclass a Model
        • No null pointer exceptions
               – “person.address.city”


                                                                            43
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Models

   Model                                                Description
   Model                                                Wraps a serializable object
   PropertyModel                                        Uses a property expression to 
                                                        dynamically access a property in 
                                                        your domain objects 
   CompoundPropertyModel                                Uses component identidiers as 
                                                        property expressions 

   LoadableDetachableModel                              Used for large data sets
   ResourceModel                                        Used for retrieving messages from 
                                                        resource bundles
   StringResourceModel                                  Adds property expressions and 
                                                        MessageFormat substitutions 
                                                                                             44
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
From Roi’s JSF presentation:

          JSF 1.2 (JSR 252):
            Shortcomings 
                    Development
                       Customizing components is complicated
                           Exceptions are not descriptive
                           No support for annotations
                    Deployment
                       Unnecessary deployment step
                       Not JEE compliant (packaging, DI)
                    Components
                       Missing components
                       Limited component functionality (DataGrid)
                    Security
                       No security model (managed beans, resources)


                                                                       45
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
descriptive exceptions!




                                                        46
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
More Features

        • Ajax Debug Window
               – Shows the ajax request and response
               – Shows exceptions 
        • Integration with other frameworks
                          Spring
                      •
                          Juice
                      •
                          Seam 2.0
                      •
                          Acegi Security
                      •
        • Nice and Secure URL’s

                                                        47
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Sessions

        • Strongly Typed Sessions

    public class MySession extends WebSession { 
       private String myAttribute; 
       private ShoppingCart cart; 
       private UserDetails userDetails; 
     
       public MySession(WebApplication application) { 
          super(application); 
       } 
       // ... getters and setters 
    } 
 

                                                         48
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Localization

             String Resource Search Order:
   •
                         Component
                  •
                         Panel (parent)
                  •
                         Page 
                  •
                         Application
                  •




                                                        49
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Agenda

         Overview

         The Wicket Way (Concepts)

         Features

         Demo
                A wicket application
                A custom component

         Q & A

                                                        50
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
Q&A
                                                        51
Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar

More Related Content

What's hot

Get Rid Of OutOfMemoryError messages
Get Rid Of OutOfMemoryError messagesGet Rid Of OutOfMemoryError messages
Get Rid Of OutOfMemoryError messages
Poonam Bajaj Parhar
 
XPages Mobile, #dd13
XPages Mobile, #dd13XPages Mobile, #dd13
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
Michael Neale
 
Visualizing and Analyzing GC Logs with R
Visualizing and Analyzing GC Logs with RVisualizing and Analyzing GC Logs with R
Visualizing and Analyzing GC Logs with R
Poonam Bajaj Parhar
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
Andres Almiray
 
Whats Cool in Java E 6
Whats Cool in Java E 6Whats Cool in Java E 6
Whats Cool in Java E 6
Arun Gupta
 
Making the HTML5 Video element interactive
Making the HTML5 Video element interactiveMaking the HTML5 Video element interactive
Making the HTML5 Video element interactive
Charles Hudson
 
JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced
Paul Bakker
 
JavaEE 6 tools coverage
JavaEE 6 tools coverageJavaEE 6 tools coverage
JavaEE 6 tools coverage
Ludovic Champenois
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Bruno Borges
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践
Jacky Chi
 
Construindo aplicações com HTML5, WebSockets, e Java EE 7
Construindo aplicações com HTML5, WebSockets, e Java EE 7Construindo aplicações com HTML5, WebSockets, e Java EE 7
Construindo aplicações com HTML5, WebSockets, e Java EE 7
Bruno Borges
 
The Tantric Team: Getting Your Automated Build Groove On
The Tantric Team: Getting Your Automated Build Groove OnThe Tantric Team: Getting Your Automated Build Groove On
The Tantric Team: Getting Your Automated Build Groove On
Atlassian
 
Why should i switch to Java SE 7
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7Vinay H G
 
High-Octane Dev Teams: Three Things You Can Do To Improve Code Quality
High-Octane Dev Teams: Three Things You Can Do To Improve Code QualityHigh-Octane Dev Teams: Three Things You Can Do To Improve Code Quality
High-Octane Dev Teams: Three Things You Can Do To Improve Code Quality
Atlassian
 
Video.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video PlayerVideo.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video Player
steveheffernan
 
Java EE 8: On the Horizon
Java EE 8:  On the HorizonJava EE 8:  On the Horizon
Java EE 8: On the Horizon
Josh Juneau
 
Avatar 2.0
Avatar 2.0Avatar 2.0
Avatar 2.0
David Delabassee
 
Web Application Defences
Web Application DefencesWeb Application Defences
Web Application Defences
Damilola Longe, CISSP, CCSP, MSc
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
Jim Jeffers
 

What's hot (20)

Get Rid Of OutOfMemoryError messages
Get Rid Of OutOfMemoryError messagesGet Rid Of OutOfMemoryError messages
Get Rid Of OutOfMemoryError messages
 
XPages Mobile, #dd13
XPages Mobile, #dd13XPages Mobile, #dd13
XPages Mobile, #dd13
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
 
Visualizing and Analyzing GC Logs with R
Visualizing and Analyzing GC Logs with RVisualizing and Analyzing GC Logs with R
Visualizing and Analyzing GC Logs with R
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
 
Whats Cool in Java E 6
Whats Cool in Java E 6Whats Cool in Java E 6
Whats Cool in Java E 6
 
Making the HTML5 Video element interactive
Making the HTML5 Video element interactiveMaking the HTML5 Video element interactive
Making the HTML5 Video element interactive
 
JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced
 
JavaEE 6 tools coverage
JavaEE 6 tools coverageJavaEE 6 tools coverage
JavaEE 6 tools coverage
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践
 
Construindo aplicações com HTML5, WebSockets, e Java EE 7
Construindo aplicações com HTML5, WebSockets, e Java EE 7Construindo aplicações com HTML5, WebSockets, e Java EE 7
Construindo aplicações com HTML5, WebSockets, e Java EE 7
 
The Tantric Team: Getting Your Automated Build Groove On
The Tantric Team: Getting Your Automated Build Groove OnThe Tantric Team: Getting Your Automated Build Groove On
The Tantric Team: Getting Your Automated Build Groove On
 
Why should i switch to Java SE 7
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7
 
High-Octane Dev Teams: Three Things You Can Do To Improve Code Quality
High-Octane Dev Teams: Three Things You Can Do To Improve Code QualityHigh-Octane Dev Teams: Three Things You Can Do To Improve Code Quality
High-Octane Dev Teams: Three Things You Can Do To Improve Code Quality
 
Video.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video PlayerVideo.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video Player
 
Java EE 8: On the Horizon
Java EE 8:  On the HorizonJava EE 8:  On the Horizon
Java EE 8: On the Horizon
 
Avatar 2.0
Avatar 2.0Avatar 2.0
Avatar 2.0
 
Web Application Defences
Web Application DefencesWeb Application Defences
Web Application Defences
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
 

Similar to Wicket Deliver Your Webapp On Time

Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Wicket Presentation @ AlphaCSP Java Web Frameworks Playoff 2008
Baruch Sadogursky
 
JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
José Maria Silveira Neto
 
ocejwcd 6 preparation guide
ocejwcd 6 preparation guideocejwcd 6 preparation guide
ocejwcd 6 preparation guide
Ganesh P
 
Agile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source FrameworksAgile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source Frameworks
Viraf Karai
 
SCWCD 5 preparation guide
SCWCD 5 preparation guideSCWCD 5 preparation guide
SCWCD 5 preparation guide
Ganesh P
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
Eduardo Pelegri-Llopart
 
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Max Andersen
 
atomPub, ruby y la api de 11870
atomPub, ruby y la api de 11870atomPub, ruby y la api de 11870
atomPub, ruby y la api de 11870David Calavera
 
jQuery (MeshU)
jQuery (MeshU)jQuery (MeshU)
jQuery (MeshU)
jeresig
 
Ajax World Oracle Ria
Ajax World Oracle RiaAjax World Oracle Ria
Ajax World Oracle Riarajivmordani
 
Ten Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesTen Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesHenrik Olsson
 
From Developer to Production, Promoting your Webservices
From Developer to Production, Promoting your WebservicesFrom Developer to Production, Promoting your Webservices
From Developer to Production, Promoting your Webservices
kingsfleet
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
Tugdual Grall
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for future
Arun Gupta
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1rajivmordani
 
ocejwsd 6 preparation guide
ocejwsd 6 preparation guideocejwsd 6 preparation guide
ocejwsd 6 preparation guide
Ganesh P
 
Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Google AppEngine (GAE/J) - Introduction and Overview from a Java GuyGoogle AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Max Völkel
 

Similar to Wicket Deliver Your Webapp On Time (20)

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
 
JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
 
ocejwcd 6 preparation guide
ocejwcd 6 preparation guideocejwcd 6 preparation guide
ocejwcd 6 preparation guide
 
Agile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source FrameworksAgile Java Testing With Open Source Frameworks
Agile Java Testing With Open Source Frameworks
 
SCWCD 5 preparation guide
SCWCD 5 preparation guideSCWCD 5 preparation guide
SCWCD 5 preparation guide
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
 
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
 
Ilog Ria2
Ilog Ria2Ilog Ria2
Ilog Ria2
 
atomPub, ruby y la api de 11870
atomPub, ruby y la api de 11870atomPub, ruby y la api de 11870
atomPub, ruby y la api de 11870
 
jQuery (MeshU)
jQuery (MeshU)jQuery (MeshU)
jQuery (MeshU)
 
Ajax World Oracle Ria
Ajax World Oracle RiaAjax World Oracle Ria
Ajax World Oracle Ria
 
Os Ramani
Os RamaniOs Ramani
Os Ramani
 
Ten Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesTen Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project Experiences
 
From Developer to Production, Promoting your Webservices
From Developer to Production, Promoting your WebservicesFrom Developer to Production, Promoting your Webservices
From Developer to Production, Promoting your Webservices
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for future
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1
 
ocejwsd 6 preparation guide
ocejwsd 6 preparation guideocejwsd 6 preparation guide
ocejwsd 6 preparation guide
 
SEASR Installation
SEASR InstallationSEASR Installation
SEASR Installation
 
Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Google AppEngine (GAE/J) - Introduction and Overview from a Java GuyGoogle AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy
 

Recently uploaded

Understanding User Needs and Satisfying Them
Understanding User Needs and Satisfying ThemUnderstanding User Needs and Satisfying Them
Understanding User Needs and Satisfying Them
Aggregage
 
-- June 2024 is National Volunteer Month --
-- June 2024 is National Volunteer Month ---- June 2024 is National Volunteer Month --
-- June 2024 is National Volunteer Month --
NZSG
 
buy old yahoo accounts buy yahoo accounts
buy old yahoo accounts buy yahoo accountsbuy old yahoo accounts buy yahoo accounts
buy old yahoo accounts buy yahoo accounts
Susan Laney
 
Building Your Employer Brand with Social Media
Building Your Employer Brand with Social MediaBuilding Your Employer Brand with Social Media
Building Your Employer Brand with Social Media
LuanWise
 
Recruiting in the Digital Age: A Social Media Masterclass
Recruiting in the Digital Age: A Social Media MasterclassRecruiting in the Digital Age: A Social Media Masterclass
Recruiting in the Digital Age: A Social Media Masterclass
LuanWise
 
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdfMeas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
dylandmeas
 
Structural Design Process: Step-by-Step Guide for Buildings
Structural Design Process: Step-by-Step Guide for BuildingsStructural Design Process: Step-by-Step Guide for Buildings
Structural Design Process: Step-by-Step Guide for Buildings
Chandresh Chudasama
 
LA HUG - Video Testimonials with Chynna Morgan - June 2024
LA HUG - Video Testimonials with Chynna Morgan - June 2024LA HUG - Video Testimonials with Chynna Morgan - June 2024
LA HUG - Video Testimonials with Chynna Morgan - June 2024
Lital Barkan
 
Best practices for project execution and delivery
Best practices for project execution and deliveryBest practices for project execution and delivery
Best practices for project execution and delivery
CLIVE MINCHIN
 
Exploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social DreamingExploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social Dreaming
Nicola Wreford-Howard
 
The effects of customers service quality and online reviews on customer loyal...
The effects of customers service quality and online reviews on customer loyal...The effects of customers service quality and online reviews on customer loyal...
The effects of customers service quality and online reviews on customer loyal...
balatucanapplelovely
 
Chapter 7 Final business management sciences .ppt
Chapter 7 Final business management sciences .pptChapter 7 Final business management sciences .ppt
Chapter 7 Final business management sciences .ppt
ssuser567e2d
 
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdfModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
fisherameliaisabella
 
Brand Analysis for an artist named Struan
Brand Analysis for an artist named StruanBrand Analysis for an artist named Struan
Brand Analysis for an artist named Struan
sarahvanessa51503
 
Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...
Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...
Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...
my Pandit
 
Training my puppy and implementation in this story
Training my puppy and implementation in this storyTraining my puppy and implementation in this story
Training my puppy and implementation in this story
WilliamRodrigues148
 
Digital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and TemplatesDigital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and Templates
Aurelien Domont, MBA
 
Authentically Social by Corey Perlman - EO Puerto Rico
Authentically Social by Corey Perlman - EO Puerto RicoAuthentically Social by Corey Perlman - EO Puerto Rico
Authentically Social by Corey Perlman - EO Puerto Rico
Corey Perlman, Social Media Speaker and Consultant
 
Discover the innovative and creative projects that highlight my journey throu...
Discover the innovative and creative projects that highlight my journey throu...Discover the innovative and creative projects that highlight my journey throu...
Discover the innovative and creative projects that highlight my journey throu...
dylandmeas
 
An introduction to the cryptocurrency investment platform Binance Savings.
An introduction to the cryptocurrency investment platform Binance Savings.An introduction to the cryptocurrency investment platform Binance Savings.
An introduction to the cryptocurrency investment platform Binance Savings.
Any kyc Account
 

Recently uploaded (20)

Understanding User Needs and Satisfying Them
Understanding User Needs and Satisfying ThemUnderstanding User Needs and Satisfying Them
Understanding User Needs and Satisfying Them
 
-- June 2024 is National Volunteer Month --
-- June 2024 is National Volunteer Month ---- June 2024 is National Volunteer Month --
-- June 2024 is National Volunteer Month --
 
buy old yahoo accounts buy yahoo accounts
buy old yahoo accounts buy yahoo accountsbuy old yahoo accounts buy yahoo accounts
buy old yahoo accounts buy yahoo accounts
 
Building Your Employer Brand with Social Media
Building Your Employer Brand with Social MediaBuilding Your Employer Brand with Social Media
Building Your Employer Brand with Social Media
 
Recruiting in the Digital Age: A Social Media Masterclass
Recruiting in the Digital Age: A Social Media MasterclassRecruiting in the Digital Age: A Social Media Masterclass
Recruiting in the Digital Age: A Social Media Masterclass
 
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdfMeas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
 
Structural Design Process: Step-by-Step Guide for Buildings
Structural Design Process: Step-by-Step Guide for BuildingsStructural Design Process: Step-by-Step Guide for Buildings
Structural Design Process: Step-by-Step Guide for Buildings
 
LA HUG - Video Testimonials with Chynna Morgan - June 2024
LA HUG - Video Testimonials with Chynna Morgan - June 2024LA HUG - Video Testimonials with Chynna Morgan - June 2024
LA HUG - Video Testimonials with Chynna Morgan - June 2024
 
Best practices for project execution and delivery
Best practices for project execution and deliveryBest practices for project execution and delivery
Best practices for project execution and delivery
 
Exploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social DreamingExploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social Dreaming
 
The effects of customers service quality and online reviews on customer loyal...
The effects of customers service quality and online reviews on customer loyal...The effects of customers service quality and online reviews on customer loyal...
The effects of customers service quality and online reviews on customer loyal...
 
Chapter 7 Final business management sciences .ppt
Chapter 7 Final business management sciences .pptChapter 7 Final business management sciences .ppt
Chapter 7 Final business management sciences .ppt
 
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdfModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
 
Brand Analysis for an artist named Struan
Brand Analysis for an artist named StruanBrand Analysis for an artist named Struan
Brand Analysis for an artist named Struan
 
Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...
Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...
Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...
 
Training my puppy and implementation in this story
Training my puppy and implementation in this storyTraining my puppy and implementation in this story
Training my puppy and implementation in this story
 
Digital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and TemplatesDigital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and Templates
 
Authentically Social by Corey Perlman - EO Puerto Rico
Authentically Social by Corey Perlman - EO Puerto RicoAuthentically Social by Corey Perlman - EO Puerto Rico
Authentically Social by Corey Perlman - EO Puerto Rico
 
Discover the innovative and creative projects that highlight my journey throu...
Discover the innovative and creative projects that highlight my journey throu...Discover the innovative and creative projects that highlight my journey throu...
Discover the innovative and creative projects that highlight my journey throu...
 
An introduction to the cryptocurrency investment platform Binance Savings.
An introduction to the cryptocurrency investment platform Binance Savings.An introduction to the cryptocurrency investment platform Binance Savings.
An introduction to the cryptocurrency investment platform Binance Savings.
 

Wicket Deliver Your Webapp On Time

  • 1.
  • 2. Apache Wicket  Deliver your web  application on time Yoav Hakman Development Manager  & Consultant, AlphaCSP 2 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 3. Agenda  Overview  The Wicket Way (Concepts)  Features  Demo  A wicket application  A custom component  Q & A 3 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 4. From Roi’s JSF presentation: JSF 1.2 (JSR 252):  Shortcomings   Development  Customizing components is complicated  Exceptions are not descriptive  No support for annotations  Deployment  Unnecessary deployment step  Not JEE compliant (packaging, DI)  Components  Missing components  Limited component functionality (DataGrid)  Security  No security model (managed beans, resources)  Ajax 4 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 5. Overview • Component based Java web framework • rich component suite • Open source (Apache 2 Licensed) • Wicket makes developing web­apps simple and  enjoyable again Flat learning curve • No XML configuration files • Very easy to create and reuse components! • Pure Object Oriented! • 5 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 6. A little bit of history 1.2 0.9 1.0 1.1 1.3 10/2004 10/2005 07/2007 06/2005 05/2006 11/2007 6 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 7. Good Documentation Wicket wiki: http://cwiki.apache.org/WICKET/ Wicket Examples (Live Demo + sources): http://www.wicketstuff.org/wicket13/ 7 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 8. From Roi’s JSF presentation: JSF 2.0 (JSR 314):  Purpose Max. development productivity (IDE)  Min. maintenance complexity  Integrate with other web tech.  More responsive UI (Ajax)   Requirements Ease of development  New Features & Fixes  Performance & Scalability  Technology Adoption  8 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 9. Agenda  Overview  The Wicket Way (Concepts)  Features  Demo  A wicket application  A custom component  Q & A 9 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 10. Wicket Templates • HTML Templates contains  • static presentation code (markup) • wicket:id  attribute­ placeholder for wicket  components • Forces the developer to keep “clean templates” • The html designer has no knowledge regarding  the business domain objects • vs jsf backing bean 10 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 11. Templates <table>  JSP:    <tr>      <c:forEach var=quot;itemquot; items=quot;${sessionScope.list}quot;>        <td>          <c:out value=quot;item.namequot; />        </td>      </c:forEach>    </tr>  </table>  <h:dataTable value=quot;#{list}quot; var=quot;itemquot;>  JSF:     <h:column>          <h:outputText value=quot;#{item.name}quot;/>      </h:column>  </h:dataTable>    <table>    <tr>  WICKET:     <td wicket:id=”list”>         <span wicket:id=”name”>power point</span>      </td>    </tr>  </table>    11 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 12. Wicket Templates • Most existing frameworks require special  HTML code. • fully compliant with the XHTML standard,  so you can use: • Macromedia Dreamweaver • Microsoft Front Page • Any other HTML editor 12 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 13. If you know Java and HTML you already know a  lot about Wicket!! 13 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 14. Linking Java and HTML public class HelloWorld extends WebPage {        public HelloWorld() {          add(new Label(quot;messagequot;, quot;Hello World!quot;));      }  }  Identifier Model <html>  <body>      <span wicket:id=quot;messagequot; id=quot;messagequot;>to be replaced</span>  </body>  </html>    14 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 15. Linking Java and HTML HTML and Java files resides in the same  classpath package 15 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 16. Object Oriented • Object Oriented • Great for Java developers  • Everything is done in Java • Swing like programming … Form form = new Form(quot;customerformquot;,                         new CompoundPropertyModel(new Customer()));  TextField zipCodeComponent = new TextField(quot;zipquot;);  zipCodeComponent.add(new ZipCodeValidator());  form.add(zipCodeComponent);    16 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 17.
  • 18. Application Class public class DemoApplication extends WebApplication {        @Override public Class getHomePage() {          return HomePage.class;      }        @Override protected void init() {          getMarkupSettings().setCompressWhitespace(false);      }    • Settings Application Settings – Debug Settings – Exception Settings – Markup Settings – Page Settings – RequestCycle Settings – Security Settings – Session Settings – 18 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 19. Application Class • The only xml configuration is the web.xml configuration! <filter>      <filter­name>DemoApplication</filter­name>      <filter­class>org.apache.wicket.protocol.http.WicketFilter</filter­      <init­param>          <param­name>applicationClassName</param­name>          <param­value>com.alphacsp.DemoApplication</param­value>      </init­param>      <init­param>          <param­name>configuration</param­name>          <param­value>development</param­value>          <!­­ <param­value>deployment</param­value> ­­>      </init­param>  </filter>    19 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 20. From Roi’s JSF presentation: JSF 1.2 (JSR 252):  Shortcomings   Development  Customizing components is complicated  Exceptions are not descriptive  No support for annotations  Deployment  Unnecessary deployment step  Not JEE compliant (packaging, DI)  Components  Missing components  Limited component functionality (DataGrid)  Security  No security model (managed beans, resources) 20 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 21. Customizing Components • Object Oriented Basics – how to extend: • By Inheritance • By Delegation public class PasswordTextField extends TextField {        public PasswordTextField(String id) {          super(id);      }        /**       * Processes the component tag       */        protected final void onComponentTag(final ComponentTag tag) {          super.onComponentTag(tag);          tag.put(quot;valuequot;, quot;quot;);      }    }    21 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 22. Customizing Components Component Hook Methods public class MyComponent extends Component {        protected void onAfterRender() {      }        protected void onBeforeRender() {      }        protected void onComponentTag(ComponentTag tag) {      }        protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)      }        protected void onModelChanged() {      }        protected void onRender(MarkupStream markupStream) {                }  }  22 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 23. Customizing Components • Object Oriented Basics – how to extend: • By Inheritance • By Delegation 23 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 24. Customizing Components public class SimpleAttributeModifier extends AbstractBehavior {      /**       * Called any time a component that has this behavior registered is        * rendering the component tag.       */      public void onComponentTag(final Component component,                                  final ComponentTag tag)    {      if (isEnabled(component))      {        tag.getAttributes().put(attribute, value);      }    }      24 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 25. Customizing Components SimpleAttributeModifer TextField myText = new TextField(quot;myTextquot;, new Model(quot;fooquot;));  myText.add(new SimpleAttributeModifier(quot;classquot;, quot;greenquot;));    With the following markup:    <input type=quot;textquot; wicket:id=quot;myTextquot;/>    Would be rendered as:    <input type=”text” wicket:id=”myText” name=”myText” class=”green”         value=”foo”/>    25 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 26. Customizing Components item.add(new AbstractBehavior() {    /**     * Called any time a component that has this behavior registered is      * rendering the component tag.     */    public void onComponentTag(Component component, ComponentTag tag) {      String css = (((Item) component).getIndex() % 2 == 0) ? quot;evenquot;:quot;oddquot;;      tag.put(quot;classquot;, css);    }  });    Output: <tr class=“odd”>…</tr>  <tr class=“even”>…</tr>    26 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 27. Customizing Components • Behaviors are used for: • Modifying attributes • Adding Java Script events • Adding Ajax Events TextField field = new TextField(quot;textfieldquot;, inputModel);  add(field);    field.add(new AjaxFormComponentUpdatingBehavior(quot;onblurquot;) {      protected void onUpdate(AjaxRequestTarget target) {      // do something here      }  });    27 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 28. Agenda  Overview  The Wicket Way (Concepts)  Features  Demo  A wicket application  A custom component  Q & A 28 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 29. From Roi’s JSF presentation: JSF 1.2 (JSR 252):  Shortcomings   Development  Customizing components is complicated  Exceptions are not descriptive  No support for annotations  Deployment  Unnecessary deployment step  Not JEE compliant (packaging, DI)  Components  Missing components  Limited component functionality (DataGrid) Security   No security model (managed beans, resources) 29 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 30. Editable table 30 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 31. Table 31 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 32. Editable Tree Table 32 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 33. DatePicker 33 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 34. Captcha 34 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 35. Modal Window 35 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 36. File Upload 36 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 37. Tabbed Panel <span wicket:id=quot;tabsquot;      class=quot;tabpanelquot;>[tabbed panel]</span>          List<ITab> tabs = new ArrayList<ITab>();          tabs.add(new AbstractTab(new Model(quot;first tabquot;)) {              public Panel getPanel(String panelId) {                  return new TabPanel1(panelId);              }          });          tabs.add(new AbstractTab(new Model(quot;second tabquot;)) {              public Panel getPanel(String panelId) {                  return new TabPanel2(panelId);              }          });          tabs.add(new AbstractTab(new Model(quot;third tabquot;)) {              public Panel getPanel(String panelId) {                  return new TabPanel3(panelId);              }          });  37         add(new TabbedPanel(quot;tabsquot;, tabs));  Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 38. Auto Complete Component 38 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 39. Models • Holds the values of the components • Mediate between the view and domain  layer     public interface IModel {      Object getObject();      void setObject(Object object);        }    39 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 40. Models public class HelloWorld extends WebPage {        public HelloWorld() {          add(new Label(quot;messagequot;, quot;Hello World!quot;));      }  }    public class HelloWorld extends WebPage {        public HelloWorld() {          add(new Label(quot;messagequot;, new Model(quot;Hello World!quot;));      }  }      The data is constant  40 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 41. Models public class HelloWorld extends WebPage {        public HelloWorld() {          add(new TextField(quot;namequot;, new Model(person.getName()));      }  }      • Immutable, not dynamic • Can produce null pointer exceptions! person.getAddress().getCity() 41 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 42. Models personForm.add(new TextField(quot;personNamequot;, new IModel() {              public Object getObject() {                  return person.getName();              }                public void setObject(Serializable serializable) {                  person.setName((String) serializable);              }          }));    • Dynamic • Inconvenient! 42 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 43. Models new TextField(quot;personNamequot;, new PropertyModel(person, quot;namequot;));    • The expression language is more compact  than the analogous Java code  • Simpler than to subclass a Model • No null pointer exceptions – “person.address.city” 43 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 44. Models Model Description Model Wraps a serializable object PropertyModel Uses a property expression to  dynamically access a property in  your domain objects  CompoundPropertyModel Uses component identidiers as  property expressions  LoadableDetachableModel Used for large data sets ResourceModel Used for retrieving messages from  resource bundles StringResourceModel Adds property expressions and  MessageFormat substitutions  44 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 45. From Roi’s JSF presentation: JSF 1.2 (JSR 252):  Shortcomings   Development  Customizing components is complicated  Exceptions are not descriptive  No support for annotations  Deployment  Unnecessary deployment step  Not JEE compliant (packaging, DI)  Components  Missing components  Limited component functionality (DataGrid)  Security  No security model (managed beans, resources) 45 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 46. descriptive exceptions! 46 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 47. More Features • Ajax Debug Window – Shows the ajax request and response – Shows exceptions  • Integration with other frameworks Spring • Juice • Seam 2.0 • Acegi Security • • Nice and Secure URL’s 47 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 48. Sessions • Strongly Typed Sessions public class MySession extends WebSession {     private String myAttribute;     private ShoppingCart cart;     private UserDetails userDetails;       public MySession(WebApplication application) {        super(application);     }     // ... getters and setters  }    48 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 49. Localization String Resource Search Order: • Component • Panel (parent) • Page  • Application • 49 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 50. Agenda  Overview  The Wicket Way (Concepts)  Features  Demo  A wicket application  A custom component  Q & A 50 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar
  • 51. Q&A 51 Copyright AlphaCSP Israel 2007 ­ The JavaEdge Seminar