First look at Struts 2.0
My current project is looking for a web framework and how they integrate with Ajax. Right now the architect is leaning towards JSF but I wanted to take a look at Struts 2.0 and see the changes implemented and if it will be easier to implement than JSF. Struts 2.0 is the a merger of Struts and WebWork frameworks. I checked out their online tutorials and built a quick web app from scratch to see how Struts 2 worked. Now if you have ever worked with WebWork Struts 2.0 will look very similar, so similar in fact you would think you are using WebWork. In my opinion this is a very good idea because WebWork is what Struts should have been. Struts 2 abandons the ActionBean, introduces one tag lib that you don't have to setup in your web.xml file and removes all references to J2EE platform in your code. Adding OGNL and interceptors will help clean up your JSPs by making it easier to access data you would have placed in HttpSession/HttpRequest and allow you to validate your form data in an interceptor instead of JavaScript in your JSP.
I was able to create a simple application that navigated a few screens and handles form data in an afternoon. I did have some issues since I was using Java 1.4 and Struts 2 is compiled in Java 5. Thankfully that just meant finding the Java 1.4 version of the jars created with Retroweaver. Since I'm familiar with how you built web applications with WebWork I found it very easy to setup the Struts.xml and mapping my form post to actions.
If it was up to me I would be integrating Struts 2 instead of JSF. Merging WebWork with Struts was a good move for the xwork (WebWork's command pattern implementation) but it might have been too late. People are looking hard at non-Struts options since they are tired of working with Struts. The decision to merge with Stuts will increase the user base of xwork but I'm sure a few people will never give it a chance because it's now linked to Struts.
http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html

Comments