一、Struts中默认访问后缀:
1、Struts1中默认访问后缀是*.do
2、Struts2中默认访问后缀是*.action
3、如何修改默认访问后缀:
1)Struts2的.action访问后缀在哪里定义?
Struts-core-2.3.4.1.jar/org.apache.struts/default.properties中的
struts.action.extension=action,,
2)在struts.xml中进行对常量的修改
所有的项目都要使用,是一个全局配置,所以位置应该位于:
<struts>标签的后面,<package>标签的前面!
<!--指定访问后缀为action/do/没有访问后缀,都可以-->
<constant name="struts.action.extension" value="action,do,"></constant>
4、情况分析
value="action,,"
localhost:8080/struts_02/user_register OK
localhost:8080/struts_02/user_register.action OK
value="action," 或 value="action"
localhost:8080/struts_02/user_register.action OK