Detailed description of the search sequence of struts2 action names

Source: Internet
Author: User

1. Obtain the URL of the Request Path. For example, the URL is:
Http: // 127.0.0.1: 8080/struts2/test/path1/path2/path3/test. Action
2. First, find the package whose namespace is/path1/path2/path3,
If the package exists, search for the action named test in the package,
If this action is found, access this action,
If this action is not found, the system immediately redirects to the default tablespace [namespase = ""] To find the action.
If this action is found in the default tablespace, the action is executed.
If this action is not found in the default tablespace, the default action defined in the tablespace is executed.
If the default action is defined in the default tablespace, the action is executed.
If no default action is defined in the default tablespace, Error 404 cannot be found
If this package does not exist, go to step 3;

3. Find the package whose namespace is/path1/path2,
If the package exists, search for the action named test in the package,
If this action is found, access this action,
If this action is not found, the system immediately redirects to the default tablespace [namespase = ""] To find the action.
If this action is found in the default tablespace, the action is executed.
If this action is not found in the default tablespace, the default action defined in the tablespace is executed.
If the default action is defined in the default tablespace, the action is executed.
If no default action is defined in the default tablespace, Error 404 cannot be found

If the package does not exist, go to step 4;

4. Find the package whose namespace is/path1,
If the package exists, search for the action named test in the package,
If this action is found, access this action,
If this action is not found, the system immediately redirects to the default tablespace [namespase = ""] To find the action.
If this action is found in the default tablespace, the action is executed.
If this action is not found in the default tablespace, the default action defined in the tablespace is executed.
If the default action is defined in the default tablespace, the action is executed.
If no default action is defined in the default tablespace, Error 404 cannot be found
If the package still does not exist, find the action named test under the package of the default namaspace (the default namespace is an empty string ""),
If you still cannot find the action, the page prompts that the action cannot be found, and the Error 404 cannot find the content

 

In addition, if the default tablespace is not defined, access the location of the default tablespace [namespase = "] is interrupted. The system prompts that action cannot be found in step 404.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.