|
WebWork: The New Framework on the Block
by Benoy Jose
The latest framework to add itself to the ranks shares the same objectives as all the others-to be easy-to-use, pluggable, scalable, etc. WebWork distinguishes itself by having understood existing framworks' limitations and working to eliminate them. It's got a lot of unique featureslike type conversion, continuations, and interceptorsnone of which are included in any of the popular frameworks on the market. And unlike Struts, WebWork also supports multiple-view technologies like JSP, velocity, and FreeMarker.
You don't need to learn WebWork from scratchits features mirror most of the popular frameworks in the market,like Struts and Spring. In fact, this MVC-based framework borrows most of its MVC structure from Struts.
WebWork Lifecycle
The architecture of WebWork is based on the MVC, Command, and Dispatcher patterns and the principle of Inversion of Control. The life cycle of a WebWork request begins when the servlet container receives a new request. The new request is passed through a set of filters called the filter chain and sent to the FilterDispatcher. The FilterDispatcher forwards the request to the ActionMapper to determine what needs to be done with the request. If the request requires an action, it sends an ActionMapping object back to the FilterDispatcher. If not, ActionMapper returns a null object-which indicating that no action needs be taken. The FilterDispatcher forwards the request and the ActionMapper object to the ActionProxy for further action. The ActionProxy invokes the Configuration File manager to get the attributes of the action, which is stored in the xwork.xml file and creates an ActionInvocation object. The ActionInvocation object contains attributes like the action, invocation context, result, result code, etc. The configuration file manger has access to these configuration files and is used by the ActionProxy as a gateway to the configuration files. The ActionInvocation object also has information about Interceptors that need to be invoked after or before an action is executed.
ActionInvocation invokes all the interceptors listed in the ActionInvocation object and then invokes the actual action. When the action is completed, ActionInvocation gets the action result code from the execution. It uses the action result code to lookup the appropriate result, which is usually a JSP page, a velocity template or a freemarker template associated with the result code. ActionInvocation also executes the interceptors again in the reverse order and returns the response as an HttpServletResponse.
Features
- MVC-based pluggable architecture.
- An extensive validation framework.
- Good Internationalization support.
- Flexible Type conversion library.
- Extensive tag library.
- Support for multiple view technologies like JSP, FreeMarker, and velocity.
- Extensive support for FreeMarker.
- Easy integration with third party frameworks like Hibernate and Spring.
- Easy integration with J2EE-based third party APIs.
- Interceptor support to handle multiple form submissions and validations.
- Support for expression language (ONGL).
- Reusable Web development through themes and templates.
- Support for continuations.
- Sitegraph to map the flow of the Web application.
- Config browser to see configuration files at runtime.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|