含有convention插件的struts.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.locale" value="zh_CN" />
<constant name="struts.i18n.encoding" value="UTF-8" />
<constant name="struts.convention.result.path" value="/WEB-INF/pages/" />
<constant name="struts.convention.default.parent.package"
value="crud-default" />
<constant name="struts.convention.package.locators" value="web" />
<constant name="struts.convention.action.name.lowercase"
value="true" />
<constant name="struts.convention.action.name.separator"
value="_" />
<constant name="struts.multipart.maxSize" value="4000000000" />
<!-- 用于CRUD Action的parent package -->
<package name="crud-default" extends="convention-default,json-default">
<!--
基于paramsPrepareParamsStack, 增加store
interceptor保证actionMessage在redirect后不会丢失
-->
<interceptors>
<interceptor-stack name="crudStack">
<interceptor-ref name="store">
<param name="operationMode">AUTOMATIC</param>
</interceptor-ref>
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="crudStack" />
<global-results>
<result name="executeResult" type="freemarker">/commons/execute_result.ftl</result>
<result name="exception" type="freemarker">/commons/exception.ftl</result>
</global-results>
</package>
<!--
使用Convention插件,实现约定大于配置的零配置文件风格. 特殊的Result路径在Action类中使用@Result设定.
-->
</struts>