Structure of Struts Application


Struts Tutorial Features of Struts

Structure of Struts Application

Strut implements the Model-View-Controller (MVC) design pattern.

Model: The model includes the core of the application's functionality. It wraps the state of the application. Sometimes the only functionality it contains is state. Model category not bothered about the view or controller category.

View: The view gives the presentation of the model. It is the look of the application. The view can access the model getters, but it has no knowledge of the setters. In addition, it knows nothing about the controller. The view should be notified when changes to the model occur.

Controller: The controller reacts to the user input. It creates and sets the model. The MVC implemented by the action, result and FilterDispatcher respectively. In MVC the controller's job is to map the user request to appropriate action and this job is done by FilterDispatcher. The model includes the data and the business logic and the model is implemented by the action component. The presentation component of the MVC pattern is view and view is implemented using JSP, Velocity Template, Freemaker or some other presentation-layer technology.

Struts components

1) Action handler: The action handler interacts with other layers

2) Result Handler: The result handler actually dispatches the request to view.

3) Custom Tags: The custom Tags are used render the dynamic content

4) Interceptors: An interceptor permits to adding some custom logic such as authentication, file upload to an action. Interceptors code is run before and after an Action is invoked

5) Value Stack: The ValueStack permits the expression language to find property values across multiple objects. Thus Struts2 tags can access data from the action very easily.

6) Expression Language: Struts 2 expression language is used for getting and setting properties of Java objects

7) Controller: The controller receives all incoming requests. Its primary function is the mapping of a request URI to an action class selecting the proper application module.

8) Struts-config.xml file: This file includes all of the routing and configuration information for the Struts application.

9) Action classes: It's the developer's responsibility to create these classes. They act as bridges between user-invoked URIs and business services. Actions process a request and return an ActionForward object that identifies the next component to invoke. They're part of the Controller layer, not the Model layer.

10) View resources: The view resources includes Java Server Pages, HTML pages, JavaScript and Stylesheet files, Resource bundles, JavaBeans, and Struts JSP tags.

11) ActionForms: These greatly simplify user form validation by capturing user data from the HTTP request. They act as a "firewall" between forms (Web pages) and the application (actions). These components allow the validation of user input before proceeding to an Action. If the input is invalid, a page with an error can be displayed.

12) Model componenets: The Struts Framework has no built-in support for the Model layer. A strut supports any model components. Some model components are,

  • JavaBeans
  • EJB
  • JDO
  • any other

Struts Tutorial Features of Struts


Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Download Projects


Buy Websites 9999595223

Buy Fresh and Payment Receive Account with Website. Contact on: or 9999595223 Try this Keyword C++ Programs