270 likes | 382 Views
Wicket introduction. 2008-10-29 Davey.wu. Agenda. What is wicket Why wicket Wicket Components Ajax Behavior Wicket Validate Wicket Tester Other. What is wicket: Hello World. Create web with just java + html. Just java + html = wicket. Example: Hello, world. What is wicket.
E N D
Wicket introduction 2008-10-29 Davey.wu
Agenda • What is wicket • Why wicket • Wicket Components • Ajax Behavior • Wicket Validate • Wicket Tester • Other
What is wicket: Hello World • Create web with just java + html. • Just java + html = wicket. • Example: Hello, world
What is wicket • Apache web framework. • Like Swing Style. • Component oriented. • Model-3,Pull against push. • Rule-based, no xml configuration.
Why wicket • Just java + html • Object oriented component model easy to reused, maintain/extend, test • Very complete framework Ajax, security, redirect after post, input valid&feedback,popups,i18n…
Why wicket • Compare several Framework Table Page example (JSF, FreeMarker, JSP) problems Merge logic into normal HTML, hard to read & maintain Hard to refactoring. Hard to work with designers.
Why Wicket: vs. webwork • Compare with Webwork • Google trends
Why Wicket: Login Demo • Page Redirect: RequestCycle.get().setResponsePage(…) • Login Form's action value action="?wicket:interface=:0:loginForm::IFormSubmitListener::“ parse will do
Core Concepts • Application • Session • RequestCycle • Models • Components • Behaviors
Core Concepts • Models
Wicket Components • Some Special Demo wizard window panel tab panel tree,treetable
Wicket Components • Creating your own components: using a Panel
Ajax Behavior • AjaxLink
Ajax Behavior • Ajax behaviors are those that can receive Ajax requests.
Ajax Behavior • Creating your own Ajax components: using ajax behaior components.add( Ibehavior) add js, markup etc.
Wicket Validate:Server • FeedbackPanel • Validation
Wicket Validate:Server • Required • NumberValidator • Customized Validator: PatronCodeValidator
Wicket Validate:Client • Wicket without client validation, but you can add JS behavior. • Integrate with JQuery Validation.
Wicket test • Easy to Test: WicketTester • JDave: Wicket module
Other • Wicket + Spring • Wicket Security
Pull Vs Push • Pull vs. Push • http://java.sun.com/blueprints/patterns/MVC-detailed.html • http://www.theserverside.com/patterns/thread.tss?thread_id=22143 view model • relation
Resources • Wicket: http://wicket.apache.org/ • Wicket Stuff: http://wicketstuff.org/confluence/display/STUFFWEB/Home • Eclipse plugin: http://code.google.com/p/loom-t5/
Q & A Q & A