By default, STRUTS2 is unable to process the request URL with the. do suffix (by default,. Action or not, see the Default.properties file under the Org.apache.struts2 package).
But Struts2 is a highly configurable framework, so we can configure it to handle requests with the. do suffix.
STRUTS2 provides a series of constants for us to configure.
For example: We can configure in the Struts.xml file
Java code <constant name= "Struts.action.extension" value= "Do"/>
If you configure multiple, you can separate them with commas
Such as:
Java code <constant name= "Struts.action.extension" value= "Do,action"/>
Enables STRUTS2 to handle URLs with the. do suffix.
At the same time, we can configure it through resource files.
You can create a struts.properties file under the classpath of our project.
You can then add to this resource file
Reference
Struts.action.extension=do
STRUTS2 also provides other ways to load constants, which are recommended for configuration in Struts.xml files.
The order of the STRUTS2 load constants is:
Reference
Struts-default.xml
Struts-plugin.xml
Struts.xml
Struts.properties
Xml
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