WebWork
Encyclopedia
WebWork was a Java-based web application framework
Web application framework
A web application framework is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities performed in Web development...

 developed by OpenSymphony
OpenSymphony
OpenSymphony was an Open Source computer software project dedicated to providing enterprise class Java EE components. OpenSymphony shut down sometime around 2009-2010, but some of the subprojects are now maintained elsewhere...

 that merged into the current Struts2 framework. It was developed with the specific intention of improving developer productivity and code simplicity. WebWork is built on top of XWork, which provides a generic command pattern
Command pattern
In object-oriented programming, the command pattern is a design pattern in which an object is used to represent and encapsulate all the information needed to call a method at a later time...

 framework as well as an Inversion of Control
Inversion of Control
In software engineering, Inversion of Control is an abstract principle describing an aspect of some software architecture designs in which the flow of control of a system is inverted in comparison to procedural programming....

 container.

WebWork provides robust support for building reusable UI templates, such as form controls, UI themes, internationalization
Internationalization
In economics, internationalization has been viewed as a process of increasing involvement of enterprises in international markets, although there is no agreed definition of internationalization or international entrepreneurship...

, dynamic form parameter mapping to JavaBeans
JavaBeans
JavaBeans are reusable software components for Java. Practically, they are classes written in the Java programming language conforming to a particular convention. They are used to encapsulate many objects into a single object , so that they can be passed around as a single bean object instead of as...

, robust client and server side validation, etc.

Design goals and overview

In a standard Java EE
Java Platform, Enterprise Edition
Java Platform, Enterprise Edition or Java EE is widely used platform for server programming in the Java programming language. The Java platform differs from the Java Standard Edition Platform in that it adds libraries which provide functionality to deploy fault-tolerant, distributed, multi-tier...

 web application, the client will typically submit information to the server via a web form
Form (web)
A webform on a web page allows a user to enter data that is sent to a server for processing. Webforms resemble paper or database forms because internet users fill out the forms using checkboxes, radio buttons, or text fields...

. The information is then either handed over to a Java Servlet
Java Servlet
A servlet is a Java programming language class used to extend the capabilities of servers that host applications accessed via a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by Web servers...

 which processes it, interacts with a database and produces an HTML-formatted response, or it is given to a JavaServer Pages
JavaServer Pages
JavaServer Pages is a Java technology that helps software developers serve dynamically generated web pages based on HTML, XML, or other document types...

 (JSP) document which intermingles HTML and Java code to achieve the same result. Both approaches are often considered inadequate for large projects because they mix application logic with presentation and make maintenance difficult.

WebWork attempts to understand existing frameworks' limitations and works to eliminate them. It supports type conversion, continuations, and interceptors. WebWork also supports multiple-view technologies like JSP, velocity, and FreeMarker.

Ultimately, WebWork has been designed and implemented with a specific set of goals, that are very important for its users. They are as follows:
  1. Web Designer never has to touch Java code
  2. Create multiple "Web Skins" for an application
  3. Change Look and Feel
  4. Change Layout on a given Web Page
  5. Change Flow among Web Pages
  6. Move *existing* data elements from one page to another
  7. Integrate with various backend infrastructures
  8. Reuse components
  9. Perform internationalization (i18n)
    Internationalization and localization
    In computing, internationalization and localization are means of adapting computer software to different languages, regional differences and technical requirements of a target market...

     of a web application
  10. Keep the API small and to the point
  11. Ability to learn WebWork fast, by making all the fancier features optional
  12. Allow the developer to choose how to implement as much as possible, while providing default implementations that work well in most cases http://www.opensymphony.com/webwork_old/src/docs/manual/faq.html

WebWork lifecycle

The architecture of WebWork is based on the MVC
Model-view-controller
Model–view–controller is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" from the user interface , permitting independent development, testing and maintenance of each .Model View Controller...

, 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, indicating that no action needs to 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 manager 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 a HttpServletResponse. http://javaboutique.internet.com/reviews/webworks/

WebWork / Struts merger

On November 27th, 2005, WebWork developer Patrick Lightbody announced that WebWork would be merging in to Struts
Apache Struts
Apache Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in...

2. http://blogs.opensymphony.com/webwork/2005/11/webwork_joining_struts.html While the next major release (WebWork 2.2.x) was released under the WebWork name, all future major revisions (namely, 2.3.x and beyond) would be folded into Struts2.

Ted Husted, developer of Struts admitted in an email that WebWork is very similar to Struts 1.x and in fact does certain things better than Struts. Both Husted and Lightbody's rationale was that combining WebWork's superior technology and Struts' superior community could only have a good effect on the Java community as a whole.

License

WebWork uses the OpenSymphony Software License which is a modified (and fully compatible with) Apache Software License.

See also

  • Apache Struts
    Apache Struts
    Apache Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in...

  • JavaServer Faces
    JavaServer Faces
    JavaServer Faces is a Java-based Web application framework intended to simplify development integration of web-based user interfaces....

  • Tapestry
    Tapestry (programming)
    Apache Tapestry is an open-source component-oriented Java web application framework to implement applications in accordance with the model-view-controller architectural pattern. Tapestry was created by Howard Lewis Ship independently, and was adopted by the Apache Software Foundation as a top-level...

  • Struts2

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK