[JAVA] Role organization memo in Struts

Introduction of typical components provided by Struts

Controller

ActionServlt

A class that extends javax.servlet.http.HttpServlet. It acts purely as a controller, centrally receives requests from clients, delegates processing to the appropriate action class, and passes the results to JSP, which acts as a view.

ActionMapping

The action mapping maps the fully qualified name of the action class to the requested URL pattern, mapping to the action class that encapsulates the business logic and to the JSP that is the response destination. Do. View and controller can be kept independent through action mapping.

Action

The Action class handles the processing of the business logic implemented in the corresponding bean etc. for the request. The action Servlet calls the execute () method of the action class, which performs processing such as authentication and validation to call the appropriate business logic.

ActionForward

The return type of the execute () method of the action class is the ActionForward class. This class tells the Action Servlet where to pass control next. This forward destination is also described in the configuration file struts-config.xml and used in the same way as mapping.

Model

Struts does not specify how the business logic called from the action class is implemented.

View

ActionForm

Used to hold form information for client requests and interact between actions, business logic, and views.

DynaActionForm

A simple class of the ActionForm class. Generated by the form-bean element in struts-config.xml, If you don't need to do anything special, this is easier and better than implementing a subclass that inherits from the ActionForm class.

MessageResources

Struts is based on the idea of message localization. In addition, it obtains field labels and messages from MessageRecources, and provides a mechanism for centrally managing messages and labels.

Recommended Posts

Role organization memo in Struts
Disadvantages in selecting Struts1
String output method memo in Ruby
Memo to get with Struts2 + Ajax