This article will introduce the numbering in the namespace configuration variables of Struts2, and hope it will be helpful to you.
What is the significance of the namespace of the Struts2 note package?
Struts. xml configuration file of struts2
There is a label in it:
<Package>
This tag has an attribute namespace.
This attribute is used to process the case where the same Web application contains an Action with the same name. Strtuts2 manages actions in a namespace.
In this way, we can avoid the need for an action with the same name sometimes, but the service processing needs are different. Therefore, we can use namespace to achieve this effect. In this way, even if there is an action with the same name but the package name is different, the actions that finally accept business processing are different. It is similar to the first class of the third class (1) and the first class of the third class (2), although the two students have the same seat number. However, we can still identify specific students with different class names. This is probably the case.
This is the same as package in java.
Note: If the specified namespace attribute is not configured for <package/>, all actions under the package are in the default package space.
Configuration variables of Struts2 notes
Struts. enable. SlashesInActionNames
If the name attribute of action needs to contain a slash/, set this variable to true.
Struts. enable. DynamicMethodInvocation
When this configuration variable is set to true, the dynamic action method is supported. Allows an action to configure multiple business requests.
An error occurs because the action name contains vertices or hyphens.
Although the Action name can be very flexible, If you assign a value with a dot (.) or hyphen (-) to the name attribute
For example, my. user or my-action may cause unknown exceptions. Therefore, it is not recommended to use dot (.) and hyphen (-) in the name attribute value of Action (-).
Excerpt from: Lightweight J2EE Enterprise Application Practice P186