幻灯片 1 - Google Code

Download Report

Transcript 幻灯片 1 - Google Code

Wicket introduction
2008-10-29
Davey.wu
红杉树(中国)信息技术有限公司公司
地址:杭州市天目山路176号西湖数源软件园11号楼3层
电话:(86)-0571-89939888
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
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
Wicket Components
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
•
view
relation
model
• http://java.sun.com/blueprints/patterns/MV
C-detailed.html
• http://www.theserverside.com/patterns/thr
ead.tss?thread_id=22143
Resources
• Wicket: http://wicket.apache.org/
• Wicket Stuff:
http://wicketstuff.org/confluence/display/ST
UFFWEB/Home
• Eclipse plugin:
http://code.google.com/p/loom-t5/
Resources
Q&A
Q&A