SlideShare ist ein Scribd-Unternehmen logo
1 von 65
Apache Wicket
Web applications with just Java
Martijn Dashorst

•   Committer

•   Chair

•   Author
Martijn Dashorst

•   Committer

•   Chair

•   Author
Agenda

• What is Wicket?
• Wicket concepts
• Wicket roadmap
Wicket?
Wicket?
Wicket

• Component oriented
• Open source
• Web application framework
• Java+HTML
Hello, World!
Hello, World!
Hello, World!
<h1 wicket:id=”msg”>[text goes here]</h1>
Hello, World!
<h1 wicket:id=”msg”>[text goes here]</h1>
                    +
  add(new Label(“msg”, “Hello, World!”));
Hello, World!
<h1 wicket:id=”msg”>[text goes here]</h1>
                    +
  add(new Label(“msg”, “Hello, World!”));
                    =
         <h1>Hello, World!</h1>
A brief history of Wicket
• Discovery of the Hobbit
  • Year of the monkey
  • Milau bridge opens




                                                           2004
photo by: 5lab (http://flickr.com/photos/5lab/382292934/)
2005
• Dr. Who returns
• A380’s maiden flight
• Huygens lands on Titan
2005
• Dr. Who returns
• A380’s maiden flight
• Huygens lands on Titan
First Wicket meetup
First Wicket meetup
First Wicket meetup
JavaOne’05
JavaOne’05
     Tapestry
       guy         Bald     Struts/Shale
                   guy          guy




                                   Wicket
JSF guy           WebWork           guy
                    guy
JavaOne’05



Wicket 1.0
Wicket uptake
Wicket uptake
Wicket 1.0
 released
Wicket uptake
                Wicket 1.2
                 released
Wicket 1.0
 released
Wicket uptake
                      Wicket 1.2
                       released
Wicket 1.0
 released




             Joined
             Apache
Wicket uptake

Dice (US)       15

Indeed (US)     85
 Monster        29
 (world)
Popular?

Java Software


Apache Software Foundation


Web frameworks
Projects
•   core

•   extensions
                                         Wicket
                                                            Welcome to
                                                                       Apache Wick
                                                                                   et
                                          Home
                                                           With proper
                                   Introduction                           mark-up/logic
                                                                                            separation, a
                                                           makes devel
                                  Planet Wick                                                             POJO data mo
                                                                         oping web-ap
                                              et                                                                          del, and a ref
                                                                                          ps simple an
                                                          brittle code                                                                   reshing lack
                                                                                                       d enjoyable
                                                                         for powerful,
                                    Community                                                                       again. Swap                        of XML, Apach
                                                                                         reusable comp                            the boilerplate                    e Wicket
                                                                                                        onents writte                             , complex de
                                                                                                                      n with plain
                                                             Check the fea                                                                                      bugging and
                                            News                                                                                    Java and HTML
                                                                              ture list                                                              .
                                                             Read some Wi
                                                                              cket buzz, so
                            Getting Star                                                     me Wicket blo
                                                            Find out why




•
                                         ted                                                                gs or Planet
                                                                             you should us                                Wicket
                                                                                             e Wicket
                                                            Check out so
                                                                            me selected
                                                                                           examples in
                                     Examples               Take a look



    ioc (spring, guice)
                                                                                                        detail or see
                                                                           at our live co                             them and ma
                                                                                          mponent ref
                                Getting Wick                Go and down                                                              ny more in live
                                                                                                       erence
                                             et                             load Wicket.                                                               action
                                 Components
                                                         Wicket is rel
                                                                       eased under
                                   QuickStart                                          the Apache Lic
                                                                                                      ense, Version
                                                                                                                     2.0.
                                                         Commun      ity meetings
                          Documentatio
                                       n
                                                         The Wicket co
                                                                         mmunity is a
                                         Wiki                                          very active co
                                                         But for those                                mmunity. Th
                                                                        that prefer fac                               e mailing list
                                                                                        e to face me
                                       Blogs                                                                                        s and the irc
                                                                                                     etings, severa




•
                                                                                                                                                    channel are
                                                                                                                      l community                               proof of that.
                                   Reference                                                                                         members ha
                                                                                                                                                   ve organized
                                                                                Where                                                                           meetups.
                                                        London, The
                                      Vision



    date/time
                                                                        United Kingd
                                                                                      om                                                     When
                                   JavaDocs             Amsterdam,                                              The first Tuesd
                                                                      The Netherla
                                                                                     nds                                          ay of every mo
                                                        Antwerp, Belgi                                                                             nth
                                                                                                                Nov. 30th, 20
                                                                        um
                                 Releases                                                                                       07
                                                       Copenhagen                                              JavaPolis'07
                                                                     , Denmark                                                (dec 12th-14
                              Wicket 1.3-r                                                                                                   th)
                                                       Linz/Hagenbe
                                           c                                                                   to be determi
                                                                       rg, Austria                                             ned
                                 Wicket 1.2           Stockholm, Sw                                           to be determi
                                                                       eden                                                    ned
                                Wicket 1.1            Rio de Janeir                                           Januari
                                                                    o, Brazil
                                Wicket 1.0           Minneapolis/                                            to be determi
                                                                    Seattle, USA




•
                                                                                                                              ned
                          Tool suppor                                                                        to be determi
                                                    If you are int                                                           ned
                                      t


    velocity
                                                                   erested in att
                                                                                   ending one of
                                                    you want to                                   these events
                                                                   organize such
                              IDE plugins                                                                        , please add
                                                                                    a meetup yo                                 yourself to the
                                                                                                 urself, add it                                   appropriate
                                                                                                                to the comm
                                                    News                                                                                                      event, or if
                                                                                                                               unity meetups
                           Developers                                                                                                            page
                                                   Apache Wick
                          Reporting bu                         et 1.3.0-rc1
                                       gs
                                                                            is released!
                            Writing docs
                                                   Nov 11, 2007
                                Building
                                                   This release
                                                                is the first in




•
                                                                                a series of rel
                                                                                                ease candidate
                                                                                                               s until we fee
                                                                                                                              l confident to



    auth-roles
                                                                                                                                             finalize Wicke
                                                                                                                                                            t 1.3. This
Getting Wicket

• Everybody gets the
  ultimate edition
• Includes sources
• Currently 1.3-rc1
• Or...
Use maven

<dependency>
  <groupId>org.apache.wicket</groupId>
  <artifactId>wicket</artifactId>
  <version>1.3.0-rc1</version>
</dependency>
Agenda

• What is Wicket?
• Wicket concepts
• Wicket roadmap
Concepts
• Application
• Session
• RequestCycle
• Components
• Behaviors
• Models
Application

• Main entry point for your web application
• Initialization
• Configuration
• Homepage
• Factories
Application
•   Configured in web.xml:
    <filter>
      <filter-name>wicket</servlet-name>
      <filter-class>
          org.apache.wicket.protocol.http.WicketFilter
      </filter-class>
      <init-param>
          <param-name>applicationClassName</param-name>
          <param-value>example.MyApplication</param-value>
      </init-param>
    </filter>
Concepts
• Application
• Session
• RequestCycle
• Components
• Behaviors
• Models
Session


• Abstraction of a user session
• Stores session specific data
Session
class MySession extends WebSession {
   private ShoppingCart cart;
   public ShoppingCart getCart() { … }
   public void setCart(ShoppingCart cart) { … }
}
mysession.setCart(new ShoppingCart());
…
ShoppingCart cart = mysession.getCart();
cart.add(quantity, selectedProduct);
Concepts
• Application
• Session
• RequestCycle
• Components
• Behaviors
• Models
RequestCycle

• Encapsulates one request
• Cleans up resources at end
• Can be used as OpenSessionInViewFilter
RequestCycle
1. Create request cycle object
2. Decode the request
3. Identify request target (page, component, …)
4. Process event (onClick, onSubmit, …)
5. Respond (page, component, image, pdf, …)
6. Clean up
RequestCycle

• Two types of requests:
 • Stateful
 • Stateless
Concepts
• Application
• Session
• RequestCycle
• Components
• Behaviors
• Models
Component

• encapsulate the programmatic manipulation
  of markup
• can receive an event (onClick, onSubmit)
• know how and where to render itself
Component
 • Ultimate super class wicket.Component
         Label                ListView
    MultiLineLabel              Loop
       TextField         PagingNavigator
  PasswordTextField         ImageMap
        Image                  Button
         Link                  Ajax…
         Tree        Sorting, paging repeaters
BookmarkablePageLink          Wizard
    JasperReports           DatePicker
Component + Markup
• Component has wicket:id
• Markup has same wicket:id
• Hierarchy must match
 <h1 wicket:id=“msg”>Gets replaced</h1>

    new Label(“msg”, “Hello, World!”);
Component: Link
<a href=”#” wicket:id=”link”>Click</a>

Link link = new Link(“link”) {
   @Override public void onClick() {
      // do something
      setResponsePage(new NewPage());
   }
};
Component: AjaxLink
<a href=”#” wicket:id=”link”>Click</a>

someComponent.setOutputMarkupId(true);
AjaxLink link = new AjaxLink(“link”) {
   public void onClick(AjaxRequestTarget t) {
     // do something
     t.addComponent(someComponent);
     t.appendJavaScript(“Effects.fade(‘foo’);”);
   }
};
Component + Markup

• Some components
  have own markup file
• Put Java, markup and
  supporting files in
  same package on class
  path
A page: Hello, World!
Concepts
• Application
• Session
• RequestCycle
• Components
• Behaviors
• Models
Behaviors


• Plugins for components
• Modify markup
Behavior
link.add(new AbstractBehavior() {
    public void onComponentTag(
      Component component, ComponentTag tag) {
      tag.put(“onclick”, “return confirm(‘Are you sure?’);”);
    }
});

Output:
<a href=”...” onclick=”return confirm(‘....’);”>...</a>
Behaviors
  • Change attributes of your component’s
     markup
  • Add javascript events
  • Add Ajax behavior
component.setOutputMarkupId(true);
component.add(
  new AjaxSelfUpdatingBehavior(Duration.seconds(5)));
Concepts
• Application
• Session
• RequestCycle
• Components
• Behaviors
• Models
Models
• Models bind your POJO’s to Wicket
  components

                   PropertyModel
       Label
                   value
      (name)
                   expression

                                       Person
                   PropertyModel
       Label                       name
                   value
     (zipcode)                     zipcode
                   expression
                                   birthdate
                   PropertyModel
      Label
                   value
    (birthdate)
                   expression
Java lazy binding sucks

• Doesn’t update:
  new Label(“name”, person.getName())
• Null checks necessary:
  new Label(“street”,
         person.getAddress().getStreet())
Models
• PropertyModel:
  new PropertyModel(p, “name)
  new PropertyModel(p, “address.street”)
• CompoundPropertyModel:
  setModel(new CompoundPropertyModel(p));
  add(new Label(“name”));
  add(new Label(“address.street”));
Agenda

• What is Wicket?
• Wicket concepts
• Wicket roadmap
Roadmap
    4/22/07    4/22-4/30       couple of weeks         somewhere in june



wicket 1.2.6                         wicket 1.2.7



               wicket 1.3.0     wicket 1.3.0
                                                    wicket 1.3.0   wicket 1.3.1
                  beta              rc



                                                                        wicket x.y
                                                                          alpha      Jav
                                                                                         a
                                                                                     1.5

                 ap n
               in pro eed
                 cu v s
                   ba al
                     to fro
                       rP m
                         M
                          C
Roadmap

• Release 1.3.0 (december)
• Wicket 1.4/2.0
 • Java 5!!!!
 • first milestone release after 1.3.1-ish
Conclusions

• Easy creation and use of custom
  components
• Up and coming framework
• Popular
• Great community
Questions?

Weitere ähnliche Inhalte

Mehr von 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
 
Java Serialization Deep Dive
Java Serialization Deep DiveJava Serialization Deep Dive
Java Serialization Deep DiveMartijn 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
 
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
 
Guide To Successful Graduation at Apache
Guide To Successful Graduation at ApacheGuide To Successful Graduation at Apache
Guide To Successful Graduation at ApacheMartijn Dashorst
 

Mehr von 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
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
Wicket 2010
Wicket 2010Wicket 2010
Wicket 2010
 
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
 
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
 

Kürzlich hochgeladen

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Kürzlich hochgeladen (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Apache Wicket: Web Applications With Just Java

  • 2. Martijn Dashorst • Committer • Chair • Author
  • 3. Martijn Dashorst • Committer • Chair • Author
  • 4. Agenda • What is Wicket? • Wicket concepts • Wicket roadmap
  • 7. Wicket • Component oriented • Open source • Web application framework • Java+HTML
  • 11. Hello, World! <h1 wicket:id=”msg”>[text goes here]</h1> + add(new Label(“msg”, “Hello, World!”));
  • 12. Hello, World! <h1 wicket:id=”msg”>[text goes here]</h1> + add(new Label(“msg”, “Hello, World!”)); = <h1>Hello, World!</h1>
  • 13. A brief history of Wicket
  • 14. • Discovery of the Hobbit • Year of the monkey • Milau bridge opens 2004 photo by: 5lab (http://flickr.com/photos/5lab/382292934/)
  • 15.
  • 16. 2005 • Dr. Who returns • A380’s maiden flight • Huygens lands on Titan
  • 17. 2005 • Dr. Who returns • A380’s maiden flight • Huygens lands on Titan
  • 22. JavaOne’05 Tapestry guy Bald Struts/Shale guy guy Wicket JSF guy WebWork guy guy
  • 26. Wicket uptake Wicket 1.2 released Wicket 1.0 released
  • 27. Wicket uptake Wicket 1.2 released Wicket 1.0 released Joined Apache
  • 28. Wicket uptake Dice (US) 15 Indeed (US) 85 Monster 29 (world)
  • 29. Popular? Java Software Apache Software Foundation Web frameworks
  • 30. Projects • core • extensions Wicket Welcome to Apache Wick et Home With proper Introduction mark-up/logic separation, a makes devel Planet Wick POJO data mo oping web-ap et del, and a ref ps simple an brittle code reshing lack d enjoyable for powerful, Community again. Swap of XML, Apach reusable comp the boilerplate e Wicket onents writte , complex de n with plain Check the fea bugging and News Java and HTML ture list . Read some Wi cket buzz, so Getting Star me Wicket blo Find out why • ted gs or Planet you should us Wicket e Wicket Check out so me selected examples in Examples Take a look ioc (spring, guice) detail or see at our live co them and ma mponent ref Getting Wick Go and down ny more in live erence et load Wicket. action Components Wicket is rel eased under QuickStart the Apache Lic ense, Version 2.0. Commun ity meetings Documentatio n The Wicket co mmunity is a Wiki very active co But for those mmunity. Th that prefer fac e mailing list e to face me Blogs s and the irc etings, severa • channel are l community proof of that. Reference members ha ve organized Where meetups. London, The Vision date/time United Kingd om When JavaDocs Amsterdam, The first Tuesd The Netherla nds ay of every mo Antwerp, Belgi nth Nov. 30th, 20 um Releases 07 Copenhagen JavaPolis'07 , Denmark (dec 12th-14 Wicket 1.3-r th) Linz/Hagenbe c to be determi rg, Austria ned Wicket 1.2 Stockholm, Sw to be determi eden ned Wicket 1.1 Rio de Janeir Januari o, Brazil Wicket 1.0 Minneapolis/ to be determi Seattle, USA • ned Tool suppor to be determi If you are int ned t velocity erested in att ending one of you want to these events organize such IDE plugins , please add a meetup yo yourself to the urself, add it appropriate to the comm News event, or if unity meetups Developers page Apache Wick Reporting bu et 1.3.0-rc1 gs is released! Writing docs Nov 11, 2007 Building This release is the first in • a series of rel ease candidate s until we fee l confident to auth-roles finalize Wicke t 1.3. This
  • 31. Getting Wicket • Everybody gets the ultimate edition • Includes sources • Currently 1.3-rc1 • Or...
  • 32. Use maven <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket</artifactId> <version>1.3.0-rc1</version> </dependency>
  • 33.
  • 34. Agenda • What is Wicket? • Wicket concepts • Wicket roadmap
  • 35. Concepts • Application • Session • RequestCycle • Components • Behaviors • Models
  • 36. Application • Main entry point for your web application • Initialization • Configuration • Homepage • Factories
  • 37. Application • Configured in web.xml: <filter> <filter-name>wicket</servlet-name> <filter-class> org.apache.wicket.protocol.http.WicketFilter </filter-class> <init-param> <param-name>applicationClassName</param-name> <param-value>example.MyApplication</param-value> </init-param> </filter>
  • 38. Concepts • Application • Session • RequestCycle • Components • Behaviors • Models
  • 39. Session • Abstraction of a user session • Stores session specific data
  • 40. Session class MySession extends WebSession { private ShoppingCart cart; public ShoppingCart getCart() { … } public void setCart(ShoppingCart cart) { … } } mysession.setCart(new ShoppingCart()); … ShoppingCart cart = mysession.getCart(); cart.add(quantity, selectedProduct);
  • 41. Concepts • Application • Session • RequestCycle • Components • Behaviors • Models
  • 42. RequestCycle • Encapsulates one request • Cleans up resources at end • Can be used as OpenSessionInViewFilter
  • 43. RequestCycle 1. Create request cycle object 2. Decode the request 3. Identify request target (page, component, …) 4. Process event (onClick, onSubmit, …) 5. Respond (page, component, image, pdf, …) 6. Clean up
  • 44. RequestCycle • Two types of requests: • Stateful • Stateless
  • 45. Concepts • Application • Session • RequestCycle • Components • Behaviors • Models
  • 46. Component • encapsulate the programmatic manipulation of markup • can receive an event (onClick, onSubmit) • know how and where to render itself
  • 47. Component • Ultimate super class wicket.Component Label ListView MultiLineLabel Loop TextField PagingNavigator PasswordTextField ImageMap Image Button Link Ajax… Tree Sorting, paging repeaters BookmarkablePageLink Wizard JasperReports DatePicker
  • 48. Component + Markup • Component has wicket:id • Markup has same wicket:id • Hierarchy must match <h1 wicket:id=“msg”>Gets replaced</h1> new Label(“msg”, “Hello, World!”);
  • 49. Component: Link <a href=”#” wicket:id=”link”>Click</a> Link link = new Link(“link”) { @Override public void onClick() { // do something setResponsePage(new NewPage()); } };
  • 50. Component: AjaxLink <a href=”#” wicket:id=”link”>Click</a> someComponent.setOutputMarkupId(true); AjaxLink link = new AjaxLink(“link”) { public void onClick(AjaxRequestTarget t) { // do something t.addComponent(someComponent); t.appendJavaScript(“Effects.fade(‘foo’);”); } };
  • 51. Component + Markup • Some components have own markup file • Put Java, markup and supporting files in same package on class path
  • 52. A page: Hello, World!
  • 53. Concepts • Application • Session • RequestCycle • Components • Behaviors • Models
  • 54. Behaviors • Plugins for components • Modify markup
  • 55. Behavior link.add(new AbstractBehavior() { public void onComponentTag( Component component, ComponentTag tag) { tag.put(“onclick”, “return confirm(‘Are you sure?’);”); } }); Output: <a href=”...” onclick=”return confirm(‘....’);”>...</a>
  • 56. Behaviors • Change attributes of your component’s markup • Add javascript events • Add Ajax behavior component.setOutputMarkupId(true); component.add( new AjaxSelfUpdatingBehavior(Duration.seconds(5)));
  • 57. Concepts • Application • Session • RequestCycle • Components • Behaviors • Models
  • 58. Models • Models bind your POJO’s to Wicket components PropertyModel Label value (name) expression Person PropertyModel Label name value (zipcode) zipcode expression birthdate PropertyModel Label value (birthdate) expression
  • 59. Java lazy binding sucks • Doesn’t update: new Label(“name”, person.getName()) • Null checks necessary: new Label(“street”, person.getAddress().getStreet())
  • 60. Models • PropertyModel: new PropertyModel(p, “name) new PropertyModel(p, “address.street”) • CompoundPropertyModel: setModel(new CompoundPropertyModel(p)); add(new Label(“name”)); add(new Label(“address.street”));
  • 61. Agenda • What is Wicket? • Wicket concepts • Wicket roadmap
  • 62. Roadmap 4/22/07 4/22-4/30 couple of weeks somewhere in june wicket 1.2.6 wicket 1.2.7 wicket 1.3.0 wicket 1.3.0 wicket 1.3.0 wicket 1.3.1 beta rc wicket x.y alpha Jav a 1.5 ap n in pro eed cu v s ba al to fro rP m M C
  • 63. Roadmap • Release 1.3.0 (december) • Wicket 1.4/2.0 • Java 5!!!! • first milestone release after 1.3.1-ish
  • 64. Conclusions • Easy creation and use of custom components • Up and coming framework • Popular • Great community