A coworker and I were tasked with rewriting an internal application to manage our company’s workflow. We both have a background in Perl and not much Java, making us the perfect candidates to prototype potential frameworks. The following is what we came up with based on our (few) requirements:
- MVC framework
- view layer must allow us to write html and css
- must be flexible enough to extend to other upcoming projects
The final decision ended up being struts2, mainly due to it’s flexibility. Other frameworks seemed like they would allow us to develop more quickly, but we would have been stuck with them (custom tags, combined view/controller layers, etc). With struts and hibernate for the model layer, it seemed like we could quickly move to something else easily.
Servlets/JSP/JSTL
- Pros:
- Not a lot of re-learning, everything can be done pretty much the same way as in CGI.
- We have (read: Roger has) JSP and JSTL books
- Cons:
- Requires a couple little helper classes for working with Hibernate
- JSTL isn’t especially graceful
- Doesn’t look good on a job description or resume
Tapestry
(I tested 4.1, the current GA release. 5.0 is in beta testing, and probably will be released before long. There are already books out for 5, but not really any online tutorials.)
- Home page: http://tapestry.apache.org/
- Lots of tutorials: http://tapestry.apache.org/tapestry4.1/tutorials/index.html
- Hibernate+Tapestry: http://www.hibernate.org/96.html
- Pros:
- Allows you to write HTML with only a couple of additional non-standard attributes
- Very well documented and tutorial-ed.
- One “page specification” XML file (*.page) per page, instead of a single huge XML config file
- Coding is extremely simple, most of the complexity is in the page files.
- Cons:
- Lots of different components (for page specification files) using a kind of non-standard language
- Notorious for changing API between major releases (i.e. 5.0).
Wicket
- Home page: http://wicket.apache.org/
- A dated tutorial: http://cwiki.apache.org/WICKET/newuserguide.html
- Databinder, a Wicket+Hibernate linking library: http://databinder.net/site/show/overview
- Pros:
- An Apache project, implying longevity or better integration going forward
- Lots of people think it represents the future of Java frameworks
- AJAX and jQuery integration built-in
- Cons:
- Uses a very unique design pattern, a huge rethink from standard CGI or servlet coding.
- Tutorials and other information is a bit dated, making it hard to learn, especially with the unique design pattern. (This is even more true for Databinder)
- Lots of the HTML can/should/must be generated by code, instead of by hand.
Struts
- Home page: http://struts.apache.org/
- Tutorial: http://struts.apache.org/2.x/docs/hello-world.html
- Pros:
- Fairly minimal. Struts does some things for you, but keeps the general Servlet/JSP structure more or less unchanged
- Integration with Hibernate is as simple as with Servlets/JSP
- Virtually ubiquitous
- eCommerce suite uses Struts, so we will have to know it anyhow
- Cons:
- Eats babies
- Tastes like dirt
JSF (Java Server Faces)
- Home page: http://java.sun.com/javaee/javaserverfaces/
- Tutorial: http://www.coreservlets.com/JSF-Tutorial/
- Pros:
- lightweight, flexible
- lots of available libraries
- large community
- Cons:
- heavy xml markup
- mixed jsp and html tags
- confusing, lots of files to manage for each page
GWT (Google Web Toolkit)
- Home Page: http://code.google.com/webtoolkit/
- Tutorials: http://blogs.pathf.com/agileajax/2007/07/36-gwt-tutorial.html (36 of them)
- Pros:
- Tons of documentation
- Lots of 3rd libraries
- Eclipse support
- Handles browser differences
- Active Development
- Large Community
- Code in java, compiles to javascript
- Managed by Google
- HTML/CSS support
- Cons:
- Built for AJAX (does handle permalinks/multiple pages)
- Limited set of java libraries on client side
Echo
- Home page: http://echo.nextapp.com/site/
- Tutorial: http://echo.nextapp.com/site/echo2/doc/tutorial
- Pros:
- Lacks extensive XML markup
- Straightforward, not a ton of rampup
- Cons:
- All UI components are AWT like (no html/css)
- IDE support is commercial
- Built for single page apps only






RE Wicket: I can think of a lot of other pros, but I disagree with some of your cons:
“Uses a very unique design pattern, a huge rethink from standard CGI or servlet coding”
you mean in that we use actual java objects in our design?
“Tutorials and other information is a bit dated, making it hard to learn, especially with the unique design pattern. (This is even more true for Databinder)”
wicket in action is the answer to all this. it is available electronically and soon on dead trees in your local barnes and noble or amazon. see “books” the apache site.
Lots of the HTML can/should/must be generated by code, instead of by hand.
there is practically no html generated by wicket. as a rule, wicket only /manipulates/ markup that YOU define. this means you can take a design from dreamweaver and just add behavior to it. you can also have your designer work on your markup after you’ve added behavior and with a couple small caveats, they can do whatever they want. the ability of coders and designers to do their work without stepping on each other is one of the major pros.
Johnathan, thanks for the response. We actually were very close to going with Wicket as the pros seemed to outweigh the cons by far. We ended up going with Struts for the simple reason that we already had some folks in house familiar with it and it was the most similar to our current architecture (Custom Perl MVC with Template Toolkit). Also, this is coming from a couple of guys who aren’t all that familiar with Java and some of what we saw in struts was a *safe* route.
Thanks for your comments and keep up the good work with Wicket.