struts2中的常量配置方式有两种:
1.在struts.xml中的struts标签下配置,如下代码
<!-- 解决struts2的乱码问题 -->
<constant name="struts.i18n.encoding" value="UTF-8"></constant>
<!-- 设置自定义扩展名 -->
<constant name="struts.action.extension" value="action,,xsx"></constant>
<!-- 设置开发struts2的模式 报错时会提供友好的界面提示 -->
<constant name="struts.devMode" value="true"></constant>
<!-- 设置配置文件修改后自动重新加载 开发中推荐使用 -->
<constant name="struts.configuration.xml.reload" value="true"></constant>
2.我们也可以在项目的src下新建一个struts.properties文件 然后在文件中写如下内容
#set extension
struts.action.extension = action,,xsx