|Apache Struts: A brief Introduction
Apache Struts is an open-source framework used to develop Java web application. Originally developed by the rogrammer and author Craig R. McClanahan was later taken over by the Apache Software Foundation in 2002. Strutshave provided an excellent framework for developing application easily by organizing JSP and Servlet and basic java code. Strut1 with all standard Java technologies and packages of Jakarta assists in creating an extensible
development environment. However, with the growing demand of web applications, Strut 1 does not stand firm and needs to be changed with the increasing demand. This led to the creation of Strut2, which are more users friendly
with the features like Ajax, rapid development and extensibility.
Struts is a well-organized framework based on MVC architecture. In Model-View-Controller Architecture, Model refers to the business or database code, the View represents the UI design code and the Controller refers to the navigational code. All these together makes Struts an essential framework for building Java application. But with the development of new and lightweight MVC based frameworks like Spring, Stripes and Tapestry, it becomes necessary to modify the Struts framework. So, the team of Apache Struts and another J2EE framework, WebWork of OpenSymphony joined
hand together to develop an advanced framework with all possible developing features that will make it developer and user friendly.
Struts 2 has combined features of Struts 1.x and WebWork 2 projects that advocates higher level application by using the architecture of WebWork2 with the features including a plugin framework, a new API, Ajax tags etc. So the Struts communities and the WebWork team brought together several special features in WebWork2 to make it more advance in the Open Source world. Later the name of WebWork2 has changed to Struts2. Hence, Apache Strut 2 is a dynamic, extensible framework for a complete application development from building, deploying and maintaining.
||Why Struts 2
The new version Struts 2.0 is a combination of the Sturts action framework and Webwork. According to the Struts 2.0.1 release announcement, some key features are: Why Struts 2
1 Simplified Design - Programming the abstract classes instead of interfaces is one of design problem of struts1 framework that has been resolved in the struts 2 framework. Most of the Struts 2 classes are based on interfaces and most of its core interfaces are HTTP independent. Struts 2 Action classes are framework independent and are simplified to look as simple POJOs. Framework components are tried to keep loosely coupled.
2 Simplified Actions - Actions are simple POJOs. Any java class with execute() method can be used as an Action class. Even we donít need to implement interfaces always. Inversion of Control is introduced while developing the action lasses. This makes the actions to be neutral to the underlying framework.
3 No more ActionForms - ActionForms feature is no more known to the struts2 framework. Simple JavaBean flavored actions are used to put properties directly. No need to use all String properties.
4 Simplified testability - Struts 2 Actions are HTTP independent and framework neutral. This enables to test struts applications very easily without resorting to mock objects.
5 Intelligent Defaults - Most configuration elements have a default value which can be set according to the need. Even there are xml-based default configuration files that can beoverridden according to the need.
2007 | Java Jazz Up |29
|View All Topics
|All Pages of this Issue
69 Download PDF