Detailed path mapping of Struts1

First, introduce the related concepts of struts1 xml configuration:

• Action's path:

ActionServlet forwards the user's request according to this attribute, that is, forwards the user's request to the Action with the same name. The same name means: remove the .do suffix of the request and match the path attribute value of the Action.

• Action's name:

The name attribute here is not the name of the Action itself, but the ActionForm associated with the Action. So the name attribute must be the ActionForm name that existed earlier.

• Action 的type:

This attribute is used to specify the implementation class of Action, that is, the business responsible for processing user requests.

service controller.

• Partial Forward:

Action forwarding is not forwarded to the actual JSP resource, but forwarded to the logical name, that is, the Forward name. The Forwards configured in the Action are all partial Forwards (the Forward is only valid within the Action).

The following is an example to introduce how to find the Action processing class and the corresponding jsp resources through the .do request:

1. Right-click the property button on the jsp page, select the address in the URL, select the do request and copy it. And remember to operate. E.g:

Detailed path mapping of Struts1:

2. Then search the file with the extension xml through ctrl + H in the project to find the corresponding Action processing class. Together with operate, the Action processing class of the page can be determined as the value of type "com.hundsun.fund.actions.fundinfo.StructProjectRatioAction".

Detailed path mapping of Struts1:

3. In the Action processing class, according to operate, it can be determined that the forward of the request is "structRatioSchemaList" in the return "structRatioSchemaList":

Detailed path mapping of Struts1:

4. Then search for the forwar node with name=" structRatioSchemaList " in the xml file, and finally locate the path "struRatScheManage.jsp"

target page of

Detailed path mapping of Struts1:


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325504547&siteId=291194637