Java Development, Recruitment and Consultancy

Apache Struts

Java without the Palaver

Apache Struts is a very popular web application framework that is widely used for small to enterprise-level applications. It can be used with J2EE but this is not essential. Primarily Struts provides a framework for speeding the development of the Web tier while encouraging the use of a MVC (Model View Controller) pattern. The controller is a servlet that routes requests to the model. The views are realised through the use of JSP pages. While it does not provide for object persistence directly it can easily be integrated with frameworks such as Hibernate either with or without J2EE. It does provide for JDBC connection pooling. The implementation of 'models' within Struts encourages the use of a domain object model and business logic beans.

Struts is more than just an MVC framework and is not always used as such. It is also possible to cherry-pick as it provides utility classes to handle many of the most common tasks in Web application development. It also provides comprehensive custom JSP tag libraries for outputting bean properties, generating HTML forms, iterating over various types of data structures and conditionally outputting HTML.

Struts may soon be eclipsed by Java Server Faces, which is very similar in concept but much more flexible. For instance it is possible to provide custom controllers for an application and to have more than one controller. Also, the Spring framework, conceptually very different, is gaining wide acceptance as an alternative.

further reading

An Introduction to StrutsA good non-technical overview.
Introduction to Jakarta Struts FrameworkIn true 'OnJava' style, an excellent technical starter. Short and to the point.
The Struts User GuideRemarkably clear documentation.


Listed to the right are some links to articles on Struts.