Apache Struts

Apache Struts

Infobox Software
name = Apache Struts

developer = Apache Software Foundation
latest release version = 1.3.8
latest release date = release date|2007|03|10
latest preview version = 1.3.9
latest preview date = release date|2007|08|01
operating system = Cross-platform
programming language = Java
genre = Web application framework
license = Apache License 2.0
website = http://struts.apache.org/1.x/

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 (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top level Apache project in 2005.

Struts2 is the rebranding of WebWork under the Apache Struts make.

Design goals and overview

In standard Java EE web application, the client will typically submit information to the server via a web form. The information is then either handed over to a Java Servlet which processes it, interacts with a database and produces an HTML-formatted response, or it is given to a JavaServer Pages (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.

The goal of Struts is to cleanly separate the "model" (application logic that interacts with a database) from the "view" (HTML pages presented to the client) and the "controller" (instance that passes information between view and model). Struts provides the controller (a servlet known as ActionServlet) and facilitates the writing of templates for the view or presentation layer (typically in JSP, but XML/XSLT and Velocity are also supported). The web application programmer is responsible for writing the model code, and for creating a central configuration file struts-config.xml which binds together model, view and controller.

Requests from the client are sent to the controller in the form of "Actions" defined in the configuration file; if the controller receives such a request it calls the corresponding Action class which interacts with the application specific model code. The model code returns an "ActionForward", a string telling the controller which output page to send to the client. Information is passed between model and view in the form of special JavaBeans. A powerful custom tag library allows it to read and write the content of these beans from the presentation layer without the need for any embedded Java code.

Struts also supports internationalization, provides facilities for the validation of data submitted by web forms, and includes a template mechanism called "Tiles" which (for instance) allows the presentation layer to be composed from independent header, footer, and content components.

Competing MVC frameworks

Although Struts is a well documented, mature and popular framework for building front ends to Java applications, it is facing new challenges from newer "light weight" MVC frameworks such as Spring MVC, Stripes and Tapestry. The new XForms standards and frameworks may also be another option to building complex web Form validations with Struts in the future.

The WebWork framework spun off from Apache Struts several years ago, aiming to offer enhancements and refinements while retaining the same general architecture of the original Struts framework. However, it was announced in December 2005 that Struts would re-merge with WebWork. WebWork 2.2 has been adopted as Apache Struts2, which reached its first full release in February 2007.

Sun recently brought out a new addition to the Java platform, called JavaServer Faces (JSF). Aside from the original framework, the Apache project also offers a JSF-based framework called Shale.

Other MVC frameworks that are not J2EE based include Ruby on Rails, WebObjects, Django, Catalyst, TurboGears, CakePHP, Symfony (for PHP), Zend, Achievo ATK, and CodeIgniter (for PHP). Struts4php is a version of the Struts framework for the PHP web scripting language [http://www.struts4php.org] . Girders is a port of the Struts framework in C# for Microsoft .NET [http://sourceforge.net/projects/girders] .

ee also

* Model-view-controller
* Jakarta
* Java EE
* Google Web Toolkit
* JavaServer Faces
* Stripes
* Comparison of web application frameworks

References

* James Holmes: Struts: The Complete Reference, McGraw-Hill Osborne Media, ISBN 0-07-223131-9
* Bill Dudney and Jonathan Lehr: Jakarta Pitfalls, Wiley, ISBN 978-0-471-44915-7
* Bill Siggelkow: Jakarta Struts Cookbook, O'Reilly, ISBN 0-596-00771-X
* James Goodwill, Richard Hightower: Professional Jakarta Struts, Wrox Press, ISBN 0-7645-4437-3
* John Carnell and Rob Harrop: Pro Jakarta Struts, Second Edition, Apress, ISBN 1-59059-228-X
* John Carnell, Jeff Linwood and Maciej Zawadzki: Professional Struts Applications: Building Web Sites with Struts, ObjectRelationalBridge, Lucene, and Velocity, Apress, ISBN 1-59059-255-7
* Ted Husted, etc: Struts in Action, Manning Publications Company, ISBN 1-930110-50-2
* [http://www.softwaresummit.com/2003/speakers/AshleyStrutsView.pdf Struts View Assembly and Validation] , (PDF format).
* Stephan Wiesner: Learning Jakarta Struts 1.2, Packt Publishing, 2005 ISBN 1-904811-54-X

External links

* [http://struts.apache.org/ Apache Struts' home page]
* [http://www.jamesholmes.com/struts/ Struts Console] : GUI tool for working with Struts
* [http://ianpurton.com/struts-utf-8-and-form-submissions/ Struts and UTF-8] : Handling UTF-8 in Struts with Servlet filters
* [http://www.semblance.us Semblance] : Open source Struts extensions for POJOs, XHTML templating, and a full-featured ListView
* [http://struts.application-servers.com Struts-Layout] : Rich TagLib for Struts
* [http://javaboutique.internet.com/tutorials/Struts A step-by-step Tutorial for Struts]
* [http://www.visualbuilder.com/jsp/struts/tutorial/ Struts Tutorial] : Start learning with a hands-on example and movies.
* [http://www.wantii.com/wordpress/?cat=3 Getting Started with Struts2]
* [http://www.rkcole.com/articles/struts/ Struts 2.0 Tutorials]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Apache Struts — Struts Entwickler: Apache Software Foundation Aktuelle Version: 2.1.6 (13. Januar 2009) Betriebssystem: Cross platform …   Deutsch Wikipedia

  • Apache Struts — est un framework libre servant au développement d applications web J2EE. Il utilise et étend l API Servlet Java afin d encourager les développeurs à adopter l architecture Modèle Vue Contrôleur. Apache Struts a été créé par Craig McClanahan et… …   Wikipédia en Français

  • Apache Struts — Тип Платформа программирования Разработчик Apache Software Foundation Операционная система Кроссплатформенное программное обеспечение Последняя версия 2.3.4.1 (13 а …   Википедия

  • Apache Struts — Desarrollador Apache Software Foundation [1] …   Wikipedia Español

  • Struts — Entwickler Apache Software Foundation Aktuelle Version 2.2.3.1 [1] (7. September 2011) Betriebssystem Cross platform Programmier­sprache …   Deutsch Wikipedia

  • Struts — Apache Struts Apache Struts est un framework libre servant au développement d applications web J2EE. Il utilise et étend l API Servlet Java afin d encourager les développeurs à adopter l architecture Modèle Vue Contrôleur. Apache Struts a été… …   Wikipédia en Français

  • Struts framework — Apache Struts Apache Struts est un framework libre servant au développement d applications web J2EE. Il utilise et étend l API Servlet Java afin d encourager les développeurs à adopter l architecture Modèle Vue Contrôleur. Apache Struts a été… …   Wikipédia en Français

  • Struts — Apache Struts Тип Платформа программирования Разработчик Apache Software Foundation ОС Кроссплатформенное программное обеспечение Версия 2.1.6 13 января 2009 Лицензия Apache 2.0 license …   Википедия

  • Apache Click — Developer(s) Apache Software Foundation Stable release 2.3.0 / March 27, 2011; 7 months ago (2011 03 27) …   Wikipedia

  • Apache Harmony — Тип Java Virtual Machine Разработчик Apache Software Foundation Написана на C++ и Java Операционная система Windows и Linux Последняя версия 6.0 M3 (2 сентября …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”