Struts2 default namespace and root namespace

Source: Internet
Author: User

The default namespace is "Namespace=", "", and the root namespace "namespace="/"".

<package name= "test" extends= "Struts-default" >, if no namespace is specified, the namespace defaults to "Namespace=" ".

The action in the default namespace can handle action requests under any namespace. For example, if there is a request with a URL of/barspace/bar.action and there is no action named bar under the/barspace namespace, then an action named bar under the default namespace will also handle the user request. But the action under the root namespace handles only the request for action under the root namespace, which is the difference between the root namespace and the default namespace.
The namespace has only one level. If the requested URL is/bookservice/search/get.action, the system will first look for an action named get under the/bookservice/search namespace, and if an action named get is found within that namespace, The action handles the user's request, and if it is not found, the system will go directly to the default namespace to look for an action named get, without looking for an action named get under the/bookservice namespace.

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.