Detailed search order for STRUTS2 action name

Source: Internet
Author: User

1. Gets the URL to the request path, such as the URL:
   http://127.0.0.1:8080/struts2/test/path1/path2/path3/test.action
2. First look for the package that namespace is/path1/path2/path3,
   If this package exists, look for an action named Test in this package,
       If the action is found, the action is accessed, and the
      moves to the default tablespace immediately if the action is not found [ Namespase= ""] to look for the action
          if the action is found in the default tablespace, the action is executed
          If the action is not found in the default Tablespace, execute the default action defined in the Tablespace
               If the default action is defined in the default tablespace, the action is executed
              If no default action is defined in the default tablespace, The report 404 cannot find the content error
   If this package is not present, turn to step 3;

3. Look for the package that namespace for/path1/path2,
   If this package exists, look for an action named Test in this package,
        If the action is found, access the action,
          If the action is not found, it immediately turns to the default tablespace [namespase= "] to find the action
               If the action is found in the default Tablespace, execute the action
               if the action is not found in the default tablespace, the default action defined in this tablespace is executed
                   If the default action is defined in the default Tablespace, execute the action
                   If default action is not defined in the default table space , the report 404 cannot find the contents of the error
  
   If this package is not present, go to step 4;

4. Looking for namespace for/path1 's package,
If this package is present, look for the action with the name test in this package,
If the action is found, the action is accessed.
If the action is not found, it immediately turns to the default tablespace [namespase= "] to find the action
If the action is found in the default tablespace, the action is executed
If the action is not found in the default tablespace, the default action defined in the table space is executed
If the default action is defined in the default table space, the action is executed
If no default action is defined in the default tablespace, the report 404 cannot find the content error
If this package is still not present, go to the default Namaspace package to find the action with the name test (the default namespace is an empty string ""),
If you still can't find it, the page hint can't find the action, report 404 can't find the content error

Another: If you do not define a default tablespace, you will be interrupted in this location to access the default tablespace [namespase= "], which prompts you for 404 without action

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.