If you ask me... I only know Struts 1.x framework pretty good. So good that I know where are its dark alleys, how to avoid them, how to venture into some of those alleys without getting seriously hurt.
We all have grown so much accustomed with Struts 1.x that we have now blindfolded ourselves from looking into anything new.. Something which would break away from traditional way of framing a web-application. Enter Wicket, and you are due for a surprise!
I am NOT going to tell you here how to work in Wicket. This post is NOT a tutorial for wicket. I would try to give that one soon as well.. But there are numerous tutorials on net.
This post is just raise your curiosity about this new framework. Here are few highlights about how wicket does things differently.
- Real separation of concerns
- No JSPs
- AJAX
- URL Mounting
- Unit Testing
- Validators
- Spring Integration
- Compile time issue detection
- Consistent look and feel for the pages: Templates without jsp / tiles
- Lighter app requirements.
- No jsp compilation for the first time.
- Standards compliant
- Active and helpful community
In Wicket, the entire presentation work is done in plain-old HTML (!!! Yes boss. You can kiss goodbye to all jsp, jsf, jakarta taglib, jstl, custom taglib). Due to this, now you can really have one team working on presentation layer (the designers) and other team working on development of server side dynamic pages (java geeks).
Did you ever feel that you had to write soooo much of jsp code to achieve so little? Try wicket. Since you don't have to force yourself to write stuff in jsp which was really meant to be done in java, you would feel liberated! The productivity increase would be clearly visible to you. E.g. Remember when you wanted to display a dynamic HTML table, you had to create the soup in jsp files by using logic:iterate (or c:forEach) and all sorts of logic tags to check present of fields etc etc. This is supposed to be a java code but we were forced into writing cumbersome taglib code to avoid the scriptlet usage in jsp. With wicket. You just write your regular HTML table with a dummy data row and then let java do the trick of iterating over the collection, checking for nulls / empty, anything. Whatever you can do in java, you can do to get your HTML table generated. No limitations.
Wicket has has built in support for ajax. If you want to extend the support, you can easily do so. Also Wicket can easily coexist with existing JS lib like prototype / Dojo.
You can create bookmarkable "friendly" Urls with one line. [If the url is behind a security, it would be displayed after intercepting login screen]
The new world Java development is all about Unit test driven Extreme Programming. Wicket component are completely testable by using EasyMock objects.
Rich and far-reaching validator framework. don't need to use commons-validator. Validation failure message can be easily shown back to user in feedback panel / or you can customize to show the field in error highlighted. You can also ajaxify the process of validation.
Easy in making coexistance with Spring and Hibernate, if that is selling point for you.
You can catch problems at compile time which are not possible with JSP. For example if in JSTL you were referring to a non-existent Javabean property, you may not know until the page renders.
No need to have jsp:include or tiles to define the template for your portal page to achieve consistent look. Wicket gives two ways to handle this functionality. Using "markup inheritance" (add link) and panel (add link)
You do not need tools.jar anymore in classpath since there are no jsps! Neither you need jsp-api.jar from j2ee web-container.
Pages are no longer slow the first time you access them because there is no more JSP compilation step
Your pages are guaranteed to be XHTML compliant
Help is fast on mailing list.
If you think that wickets seems to be any worthy of your attention..
Here are quick links for you to explore further:
- Download Wickets
- Wicket mailing list archive
- JTrac application. Its source code would give you insight as to how to integrating powerhouses like wicket, spring, hibernate together with the glue of maven2
- Get you hands dirty by taking a look at tutorial 1 and tutorial 2
Credits and Thanks:
I would like to thank the authors of few internet posts who elicited many of the above points beautifully in their wicket posts.
- Peter Thomas [He also authors JTac Application]
- R. J. Lorimar [He is a editor at JavaLobby.org]
Regards,
Vijay Dharap

No comments:
Post a Comment