Apache Wicket A Kick Start

Apache Wicket – A Kick Start for San Antonio Java User Group January 2010 Apache Wicket – A Kick Start Agenda • What is Wicket? • Capabilities & F...
Author: Rosaline Hunter
0 downloads 2 Views 218KB Size
Apache Wicket – A Kick Start for

San Antonio Java User Group January 2010

Apache Wicket – A Kick Start

Agenda • What is Wicket? • Capabilities & Features • Concepts & Architecture • Wicket Components • Life Cycle • Models • Demonstration

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start

What is Wicket? • • • • • •

Open source, light weight web application framework Based on just Java and HTML Component based and is conceptually similar to JSF Designed after GUI frameworks like Swing Stateful Framework Different from traditional frameworks

Tiny Facts: • First released in 2005 • An Apache project from June 2007

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Typical MVC Vs Component Based

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Capabilities & Features •

State Management – Hides the fact that Web App development is based on stateless HTTP protocol – Developers concentrate on business problems rather than plumbing code to manage state – Custom type safe sessions



Back button support – Serialized versions of pages visited by a user in session store – What is a session store? (Will discuss later)



Page Composition and Templating – Templates designed with plain XHTML (significant advantage) – Templates viewable offline in any browser and editable in WYSIWIG tools Contd..

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Capabilities & Features •

Internationalization – Locale aware markup loading – Locale aware user messages through resource bundles



Unit Testing – Wicket Tester – A JUnit based extension – Helper classes to simulate page rendering, link clicks, presence of error messages and components etc.. in a page



Type conversion between components and underlying models – Provides converters responsible for converting model attributes from native Java to String representations for a web page and vice versa – Easy to create custom converters Contd..

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Capabilities & Features •

Easy AJAX – Easy to enable AJAX in wicket apps without writing a single line of Java Script – Bunch of built in AJAX enabled components – Excellent debugging utility for debugging AJAX calls



Integration with other frameworks – Spring, Guice, Hibernate, Seam, Acegi Security – Terracotta – Open source clustering solution

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Architecture & Concepts

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Architecture & Concepts •

Application – – –



Session – – – –



Main entry point for a wicket based application Only one instance per Wicket application Used to customize debug, markup and other settings

State of the user in the application One instance per user per wicket application Creation of custom type safe sessions Stored in Http Session

Component – – –

Primary constituent of every wicket application Has its own markup and pulls its own data Rich set of components available Contd..

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Architecture & Concepts •

Request Cycle – – – –



Model – – –



Responsible for processing of all requests to a wicket app Uses Request and Response objects (wrappers of Http Servlet Request and Response) Delegates the processing steps to a request cycle processor Handles two kinds of requests: Stateful and Stateless

Binds data with wicket components Hides what data to get and from where to get Many models available

Behavior – –

Plug-ins for components that changes the component’s markup Used to add AJAX functionality and java script events to components

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Components CheckBox WebPage

Component

Label TextField

Panel Form

Button

TextArea

AjaxLink

Link

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Life Cycle • • •



Create a Request Cycle Determine Request Target Process Events – Check Required Input – Invoke Conversion – Invoke Validation – Update Model – Invoke Action Listeners Render Response

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start Wicket Models • • • • •

Static Model Dynamic Model Property Model Compound Property Model Loadable Detachable Model

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start

Questions?

San Antonio Java User Group



Subramanian Murali

Jan’ 2010

Apache Wicket – A Kick Start

Thank You

San Antonio Java User Group



Subramanian Murali

Jan’ 2010