Apache Wicket - A Comprehensive Introduction

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    3 Favorites

    Apache Wicket - A Comprehensive Introduction - Presentation Transcript

    1. Apache Wicket http://wicket.apache.org/ Component based web applications with just Java and HTML Punit Sahni
    2. Agenda
      • RESOURCES
        • ARCHITECTURE
          • ~ Industrial Strength Applications - Sites-using-wicket
          • ~ Best Practices and Gotchas
          • Patterns and anti-patterns
          • POSSIBILITIES
            • ~   Gidoocms - Wicket CMS
            • ~ Create RESTful URLs with Wicket
            • ~ Interview: How Wicket Does Ajax
            • ~ WICKET BPM
        • DEVELOPMENT
          • ~ WICKET Cheat Sheet
          • PRODUCTIVITY BOOKMARKS
            • ~ WICKET  wiki
            • ~ WICKET Framework-documentation
            • ~ WICKET Reference-library
            • ~ Wicket Stuff Wiki
          • Tutorials
            • ~ Develop a simple Web application with Apache Wicket and Apache Geronimo
            • ~ Introducing Apache Wicket
      • WHAT?
        • Essentials
        • How wickets achieves its goals
      • WHY?
        • Features
        • Integration support
        • Comapre with other Web frameworks
      • HOW?
        • Understand 6 Core Concepts
        • Pick use-cases from Wicket Examples
        • Set-up Development Env for selected use-cases
        • Understand the CODE & Working details
    3. Agenda
      • RESOURCES
        • ARCHITECTURE
          • ~ Industrial Strength Applications - Sites-using-wicket
          • ~ Best Practices and Gotchas
          • Patterns and anti-patterns
          • POSSIBILITIES
            • ~ Create RESTful URLs with Wicket
            • ~ Interview: How Wicket Does Ajax
            • ~ WICKET BPM
        • DEVELOPMENT
          • ~ WICKET Cheat Sheet
          • PRODUCTIVITY BOOKMARKS
            • ~ WICKET  wiki
            • ~ WICKET Framework-documentation
            • ~ WICKET Reference-library
            • ~ Wicket Stuff Wiki
          • Tutorials
            • ~ Develop a simple Web application with Apache Wicket and Apache Geronimo
            • ~ Introducing Apache Wicket
      • WHAT
        • Essentials
        • How wickets achieves its goals
      • WHY
        • Features
        • Integration support
        • Comapre with other Web frameworks
      • HOW
        • Understand 6 Core Concepts
        • Pick use-cases from Wicket Examples
        • Set-up Development Env for selected use-cases
        • Understand the CODE & Working details
    4. WHAT is Wicket?
      • ESSENTIALS- HOW WICKET FITS IN JEE STACK
      • Component oriented web application framework
      • A lightweight component-based web application framework CONCEPTUALLY SIMILAR TO JAVASERVER FACES AND TAPESTRY . Version 1.0 was released in June 2005. It graduated into an Apache top-level project in June 2007.[1]
      • In traditional MVC frameworks, the controller works in terms of whole requests and whole pages and is responsible for pulling data out of the model to populate the view.
      • WICKET COMPONENTS , on the other hand, ARE PATTERNED AFTER WIDGETS IN GUI FRAMEWORKS SUCH AS SWING .
      • Wicket COMPONENTS USE LISTENER DELEGATES to react to GETs and POSTs against links and forms in the same way that Swing does to react to mouse and keystroke events on widgets.
      • The COMMON IDIOM IS TO INSTANTIATE A TREE OF COMPONENTS , each of which is then bound to a named element in the XHTML. The COMPONENT THEN BECOMES RESPONSIBLE FOR RENDERING THAT ELEMENT IN THE MARKUP . The PAGE IS SIMPLY THE TOP-LEVEL CONTAINING COMPONENT and is paired with exactly one XHTML template. Reuseable parts of pages may be abstracted into components called panels , which can then be pulled whole into pages or other panels with a special tag.
      • EACH COMPONENT IS BACKED BY ITS OWN MODEL , which represents the state of the component and is automatically serialized and persisted between requests. Model objects are treated as opaque by the framework and how components interact with their models are their own business. More complex models, however, may be made detachable and provide hooks to arrange their own storage and restoration at the beginning and end of each request cycle. Wicket does not mandate any particular object-persistence or ORM layer, so applications often use some combination of Hibernate objects, EJB beans or POJOs as models.
      • Just Java and HTML; Everything in Java
      • Wicket USES PLAIN XHTML FOR TEMPLATING , to enforce a clearer separation of presentation and logic and to allow templates to be edited with conventional WYSIWYG design tools.[2]
      • Easy Ajax
      • Open Source; Enthusiastic community
      • ACHIEVES GOALS THRU
      • Component oriented
      • Utilizing an object-oriented component model where components are truly self contained
      • Making using & creating custom components easier than any framework out there
      • MVC
      • Re-applying the Model View Controller pattern on components instead of requests, with models as first class citizens
      • Having a clean separation of concerns between HTML and Java
      • Providing transparent, fully automated state management
      • Configuration
        • Minimum configuration
        • No more XML!
    5. Agenda
      • RESOURCES
        • ARCHITECTURE
          • ~ Industrial Strength Applications - Sites-using-wicket
          • ~ Best Practices and Gotchas
          • Patterns and anti-patterns
          • POSSIBILITIES
            • ~ Create RESTful URLs with Wicket
            • ~ Interview: How Wicket Does Ajax
            • ~ WICKET BPM
        • DEVELOPMENT
          • ~ WICKET Cheat Sheet
          • PRODUCTIVITY BOOKMARKS
            • ~ WICKET  wiki
            • ~ WICKET Framework-documentation
            • ~ WICKET Reference-library
            • ~ Wicket Stuff Wiki
            • Wicket library More on Wicket
          • Tutorials
            • ~ Develop a simple Web application with Apache Wicket and Apache Geronimo
            • ~ Introducing Apache Wicket
      • WHAT
        • Essentials
        • How wickets achieves its goals
      • WHY
        • Features
        • Integration support
        • Comapre with other Web frameworks
      • HOW
        • Understand 6 Core Concepts
        • Pick use-cases from Wicket Examples
        • Set-up Development Env for selected use-cases
        • Understand the CODE & Working details
    6. WHY Wicket?
      • FEATURES
        • Fancy components
          • Reusable components
          • sortable, filterable, pageable, data aware tables
          • date picker, rich text editor, Google Maps
          • tabbed panel, navigation, tree, wizard
        • Page composition
          • panels, borders and markup inheritance
          • Nested forms
        • Excellent localization and style support
          • template and resource loading (_be.html, .xml)
          • localized models (e.g. for labels)
          • sophisticated resource bundle lookup (composition & inheritance hierarchy)
          • automatic client capabilities detection
        • Ajax support and components
          • Ajax without writing JavaScript, Dojo, Scriptaculous, ...
        • Header contribution
          • Javascript & CSS
        • URL mounting
          • pretty URLs
        • State management
          • type safe sessions
        • Component level security
        • extensive logging and error reporting
        • clustering support
        • back button support
        • Double submit strategies
          • render redirect/ redirect to buffered response/ none
        • JUnit Testing support
      • INTEGRATION SUPPORT
        • Spring
        • ~  cwiki.apache.org > WICKET > Spring
        • Guice
        • Hibernate
        • JasperReports
        • OSGi
      • COMPARE WITH OTHER WEB FRAMEWORKS
        • Traditional
          • Struts, WebWork, Spring MVC, etc.
          • Proven for web
          • A lot of web developers available
        • Components
          • JSF, Wicket, Tapestry, etc.
          • Traditional model for UI development on thick clients
          • A lot of developers available
        • Why WICKET & not others?
        • Migrating to Wicket
        • ~ Wicket-impressions-moving-from-spring- mvc-webflow
        • ~ Tapestry and Wicket compared
        • ~ Wicket programming style , Part 1: The state of Wicket
        • ~ Wicket programming style, Part 2: Reducing and re-using code
        • ~ A-wicket-user-tries- jsf
        • ~ Wicket-and- gwt -compared-with-code
    7. Agenda
      • RESOURCES
        • ARCHITECTURE
          • ~ Industrial Strength Applications - Sites-using-wicket
          • ~ Best Practices and Gotchas
          • Patterns and anti-patterns
          • POSSIBILITIES
            • ~ Create RESTful URLs with Wicket
            • ~ Interview: How Wicket Does Ajax
            • ~ WICKET BPM
        • DEVELOPMENT
          • ~ WICKET Cheat Sheet
          • PRODUCTIVITY BOOKMARKS
            • ~ WICKET  wiki
            • ~ WICKET Framework-documentation
            • ~ WICKET Reference-library
            • ~ Wicket Stuff Wiki
          • Tutorials
            • ~ Develop a simple Web application with Apache Wicket and Apache Geronimo
            • ~ Introducing Apache Wicket
      • WHAT
        • Essentials
        • How wickets achieves its goals
      • WHY
        • Features
        • Integration support
        • Comapre with other Web frameworks
      • HOW
        • Understand 6 Core Concepts
        • Pick use-cases from Wicket Examples
        • Set-up Development Env for selected use-cases
        • Understand the CODE & Working details
    8. HOW? – 6 Core Concepts
      • Application
      • Session
      • Request Cycle
      • Components
      • Models
      • Behaviors
    9. Core Concept - 1 : APPLICATION
      • 1 - APPLICATION
        • Key Points
          • WebApplication Class - heart of every wicket application
          • Main entry point for your web application
          • Configuration
            • Output Wicket specific tags?
            • Watch for markup changes every …?
            • Defines homepage
          • Factories for
            • Session
            • RequestCycle
            • Security
          • 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>
            • <load-on-startup>1</load-on-startup>
            • </filter>
        • For More Information
          • ~ Lifecycle of a Wicket Application
    10. Core Concept - 2 : Session
      • 2- SESSION
        • Key Points
          • See concept of Detachable Models for large object graphs
          • Abstraction of a user session
          • Storage typically in HttpSession
          • Stores session specific data
            • Locale, Client info (browser vendor and version)
            • Your own data?
              • Logged in user
              • Shopping cart contents
          • Limited page history for back button support
        • For More Information
      • ~  Scalability and Session Management
    11. Core Concept - 3 : REQUEST CYCLE
      • 3 – REQUEST CYCLE
        • Key Points
        • Steps in a request cycle:
          • Create request cycle object
          • Decode the request
          • Identify request target (page, component, …)
          • Process event (onClick, onSubmit, …)
          • Respond (page, component, image, pdf, …)
          • Clean up
        • Two types of requests:
          • Stateful
            • Tied to specific user session
            • Not bookmarkable
          • Stateless
            • Not necessarily tied to specific user session
            • Bookmarkable
        • For More Information
        • ~ Request-processing-overview
        • ~ Request cycle and request cycle processor
          • ~ Request coding strategy
        • ~ Request targets
    12. Core Concept - 4 : COMPONENT
      • 4 - COMPONENTS
        • Key Points
        • Components are isolated pieces of Java code with supporting markup. Most components are abstract classes designed to be subclassed with your domain-specific logic and requirements. Pages and panels are components, as well as Links, Forms and ListViews.
        • Wicket components are Java Classes with supporting HTML markup
          • with Markup inheritence
          • 2 types
            • Components with Markup
              • Pages
              • Panels
            • Components with-out Markup
              • Forms
              • with submit listeners
        • encapsulate the programmatic manipulation of markup
        • can receive an event
          • onClick, onSubmit
        • know how and where to render itself
        • Ultimate super class wicket.Component
        • Label
        • MultiLineLabel
        • TextField
        • PasswordTextField
        • Image
        • Link
        • Tree
        • BookmarkablePageLink
        • JasperReports
        • ListView
        • Loop
        • PagingNavigator
        • ImageMap
        • Button
        • Ajax…
        • Sorting, paging repeaters
        • Wizard
        • DatePicker
        • ~ Wicket-extensions - more components
        • For More Information
        • ~ Component Reference
        • ~ Component hierarchy
          • ~ Pages
          • ~ Page rendering
          • ~ Component rendering
        • ~ Page maps
    13. Core Concept - 5: MODEL
      • 5 - MODELS
        • Key Points
        • Models provide an abstraction between your domain object and the Wicket components.
        • Models come in various flavors and can be combined to maximize functionality.
        • Ideally, your components should always access your domain models using models instead of directly.
        • Models bind your POJO’s to Wicket components
        • Lazy binding in Java sucks
          • Doesn’t update:
          • new TextField(“txt”, person.getName())
          • Gives null pointers:
          • new Label(“street”, person.getAddress().getStreet())
        • Solution: OGNL/EL like expressions
        • PropertyModel:
          • new PropertyModel(person, “name”)
          • new PropertyModel(person, “address.street”)
        • Be aware for nulls when using updates:
        • Person p = new Person();
        • new TextField(“street”, new PropertyModel(p, “address.street”));
        • For More Information
        • ~ Working with Wicket models
          • Detachable Models
          • Property Models
          • Compound Property Models
        • more
          • ~ Referencing Models From Inner Classes
          • ~ Filter ListView by criteria from a DropDownChoice
        • ~ More on models
    14. Core Concept - 6 :BEHAVIORS
      • 6 - BEHAVIORS
        • Key Points
        • Behaviors are plug-ins for Components
        • They can modify the components markup
            • item.add( new AbstractBehavior () {
            • public void onComponentTag(
            • Component component, ComponentTag tag) {
            • String css = (((Item)component).getIndex() % 2 == 0)
            • ? &quot;even&quot; : &quot;odd&quot;;
            • tag.put(&quot;class&quot;, css);
            • }
            • } );
        • Output: <tr class=“ odd ”>…</tr> <tr class=“ even ”>…</tr>
        • Change attributes of your component’s markup
        • Add javascript events
        • Add Ajax behavior
            • component.add( new AjaxSelfUpdatingBehavior ( Duration.seconds(1)));
        • For More Information
          • Leveraging Wicket templates for offline viewing with Dreamweaver
          • Wicket Template Example
          • Wicket behaviors to the rescue again !
          • Composite Behaviors — How to combine different behaviors into one
    15. HOW TO GET STARTED?
        • PICK USE-CASES FROM WICKET EXAMPLES
        • ~ Examples in Detail
        • ~ Examples in LIVE ACTION - Menu
        • PICK SAMPLE APPLICATIONS ( WITH COMPLETE SOURCE CODE)
        • ~ 1.  Wicket-Phonebook - http://wicket- stuff.sourceforge.net /wicket-phonebook/
          • * A Spring & Hibernate/iBATIS application showing an example of displaying a list of tabular data along with the typical CrUD opertations on it.
        • ~ 2. QWicket - http:// www.antwerkz.com/qwicket/app/home
          • * Qwicket is a quickstart application for the wicket framework. Its intent is to provide a rapid method for creating a new wicket project with the basic infrastructure in place. Currently, it only supports Spring and Hibernate built with Ant but plans include such things as support for Maven 2 and other persistence layers such as iBATIS
        • ~ 3. Databinder - http:// databinder.net/examples.html
          • * Databinder is a simple bridge from Wicket to Hibernate. Its site hosts five example database-driven webapps, each running live and with source for browsing (and one screencast). A Maven 2 archetype is available for generating Databinder projects from scratch.
        • ~ 4. Wicket- QuickStart - http://wicketframework.org/wicket-quickstart/index.html
          • * V1.2 - Intended to be a batteries-included way of getting started.
        • ~ 5. Wicket-Template - http:// sourceforge.net/project/showfiles.php?group_id =134391&package_id=197274
          • * V1.2 The equivalent of QuickStart for those developers with Maven2 and an internet connection.
          • * Small (22KB), Maven2-based project which can be used to get started quickly.
    16. HOW TO GET STARTED?
      • SET-UP DEVELOPMENT ENVIRONMENT FOR SELECTED USE-CASES
      • Goal
      • RUN the WICKET examples with Favorite IDE & Build Tool
            • ~ Follow these steps here
      • First Project
      • ~ Setup web project
      • ~ Wicket- quickstart > Eclipse + Jetty
      • For Project Code Generation ~  wicket.apache.org > Quickstart ~ QWICKET > First App with Wicket, Spring and Hibernate - Code generation
      • More Specifics
        • ~ Download WICKET
        • ~ Read - Wicket In Action - Bonus-chapter15
        • ~ To understand the steps better
      • Maven
      • ~ 1.  Wicket-Archetype - Quickstart as a Maven 2 archetype
        • IDE SPECIFIC INSTRUCTIONS
        • Eclipse
        • ~ Wicket - First Steps
        • ~ Eclipse plug-in: Wicket Bench
        • ~ Features-0.5
        • Netbeans
        • ~ How to Start Learning Wicket with Maven & NetBeans IDE
        • App server specific instructions
        • Jetty
        • Tomcat
        • ~ Integration-guides
        • ~  cwiki.apache.org > WICKET > Spring ~  wicket.sourceforge.net > Wicket-1.0 > QuickStart
      • UNDERSTAND THE CODE & WORKING DETAILS
          • ~ How-to-do-things-in-wicket
          • ~ General-applications
          • ~ How Wicket Does Ajax
    17. RESOURCES
      • ARCHITECTURE
          • ~ Industrial Strength Applications - Sites-using-wicket
          • ~ Best Practices and Gotchas
          • Patterns and anti-patterns
          • POSSIBILITIES
            • ~  Gidoocms - Wicket CMS
            • Brix CMS http://brix-cms.googlecode.com Wicket and JCR based CMS Framework. Allows developers to build dynamic CMS-based web sites using Wicket Components.
            • ~ WICKET BPM
            • ~ Create RESTful URLs with Wicket
            • Rss Page — How to create a Rss page in Wicket
            • SEO - Search Engine Optimization — Some Search Engine Optimization tricks with wicket
            • Object Container, adding Flash to a Wicket Application — Hidden Excerpt
            • Using intercept pages — - remembering last visited pages and redirectio n
    18. RESOURCES
        • DEVELOPMENT
          • ~ WICKET Cheat Sheet
          • PRODUCTIVITY BOOKMARKS
            • ~ WICKET  wiki
            • ~ WICKET Framework-documentation
            • ~ WICKET Reference-library
            • ~ Wicket Stuff Wiki
            • Wicket library More on Wicket
          • User Groups
            • http:// talks.londonwicket.org /
          • Tutorials
            • ~ Develop a simple Web application with Apache Wicket and Apache Geronimo
            • ~ Introducing Apache Wicket
            • http://www.devx.com/Java/Article/35620/1954
            • Books
            • http://www.WicketInAction.com by Manning
    19. Adoption
      • Employers
        • http://cwiki.apache.org/WICKET/wicket-employers.html
        • Hippo ECMS Hippo, supplier of Enterprise Content Management and Portal software based on Wicket, Lucene, Jackrabbit and Jetspeed.
    20. Conclusion
      • Smart component oriented web framework
      • Easy creation and use of custom components
      • Enthustiatic community
              • http://wicket.apache.org/
              • [email_address]

    + Punit SahniPunit Sahni, 10 months ago

    custom

    1474 views, 3 favs, 1 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1474
      • 1472 on SlideShare
      • 2 from embeds
    • Comments 0
    • Favorites 3
    • Downloads 6
    Most viewed embeds
    • 2 views on http://localhost

    more

    All embeds
    • 2 views on http://localhost

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories