Validation
WebWork has built-in validators that peform the most common validations required in Web forms. These default validators do the basic validationslike checking required fields, data type checking, date format checking, and email format checking. The validators are defined in XML file called validators.xml and stored in the /WEB-INF/classes directory of the Web application.
Apart from these simple validations, WebWork can also perform complex and user-defined validations based on ONGL expressions. ONGL expressions can be directly defined and used in the expression validator or the fieldexpression validator. If there are any custom validations that cannot be done by these built-in validators, you can define your own validators in the validators.xml file.
Continuations
Continuations are an interesting feature that most application frameworks do not carry. Take a case of a series of forms that are part of a wizard. Normally, you'd store the information you gathered from each individual form in session variables. This information would be processed only after all the forms are filled and you'd have to store and track the status of each form and revalidate data each time a new form was submitted.
Continuations allow you to pause the execution of an action and continue it at a later time when new information is received. So, one single action can contain the logic and validations for the whole wizard. You can program this action to pause when information is required from a subsequent form. Thethe action processing will resume at the point of the pause when data from the next form in the wizard is submitted. At this time, continuations are in the experimental stage and not used frequently, but once they are widely used. they could be very useful.
Interceptors
These powerful objects intercept action invocations and allow you to include common functionality. They can execute before and/or after an action is invoked. Interceptors come in handy when you need move commonly executed code to a common and reusable class. Some common jobs for interceptors functions are checking if a user is logged in, cleaning up request or response parameters, logging audit trail information, and checking for duplicate form submissions. Interceptors can block the execution of the action and raise exceptions if the request is not valid and is bound to fail in the action's execute method.
Utilities
Apart from these major features, WebWork provides a few built-in utilities that are helpful for development and debugging.
There's a config browser that allows you to identify configuration-related problems at runtime and debug time. This is very useful, because debugging configuration problems is usually diffucult and time-consuming.
WebWork also provides a UI flow, called SiteGraph, that displays the Web application flow. It shows different actions, forms, redirects, etc. and is useful for maintenance and enhancements.
QuickStart is another simple utility provided to jump-start the development process. This allows you to start the samples included with WebWork quicklywithout even compiling or deploying them. QuickStart provides a Perl-style quick development approach and is useful to get the project started. WebWork also provides a starter application, which is a bare bones WebWork application that can be used as a starting point for any project.
Getting Started
Download the WebWork binaries from the Opensymphony Web site. It contains all the required and optional jar files required to run WebWork. The following Web site has an elaborate tutorial that walks you through a download and installation.
Third-party Integration
WebWork has simple ways to integrate third-party software like Quartz, Spring, SiteMesh, Pico, Hibernate, JSTl, Junit, and JasperReports. Integration requires only a few configuration changes or API calls.
Integrating with Struts
Recently, OpenSymphony decided to merge with Apache and make WebWork part of the Struts framework. The merger is expected to be complete by June 2006. The finished product will be called Struts Action 2.0. Based on WebWork, the integrated product will retain most of WebWork's unique features. Hopefully, the result will be a comprehensive framework containing the best of both frameworks.
Related Resources
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.