Struts中的常量

        以下是Struts中常量的一些经常使用配置,保存下来留作积累吧。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- 把它设置为开发模式,公布时要设置为false -->
    <constant name="struts.devMode" value="true" />
    <!-- 设置在class被改动时是否热载入,公布时要设置为false -->
    <constant name="struts.convention.classes.reload" value="true"/>
    <!-- 自己主动动态方法的调用,使用这个设置后能够这样调用:action!method -->
    <constant name="struts.enable.DynamicMethodInvocation" value="true" />
    <!-- 指定jsp文件所在的文件夹地址 -->
    <constant name="struts.convention.result.path" value="/WEB-INF/content/" />
    <!-- 使用struts-default默认的转换器。假设是rest的使用:rest-default,rest须要rest的jar插件 -->
    <constant name="struts.convention.default.parent.package" value="struts-default"/>
    <!-- 用于配置包名后缀。

默觉得action、actions、struts--> <constant name="struts.convention.package.locators" value="actions" /> <!-- 用于配置类名后缀,默觉得Action,设置后。Struts2仅仅会去找这样的后缀名的类做映射 --> <constant name="struts.convention.action.suffix" value="Action"/> <!-- 设置即使没有@Action凝视,依旧创建Action映射。

默认值是false。由于Convention-Plugin是约定优于配置的风格, 能够不通过注解依据预先的定义就能訪问对应Action中的方法 --> <constant name="struts.convention.action.mapAllMatches" value="true"/> <!-- 自己定义jsp文件命名的分隔符 --> <constant name="struts.convention.action.name.separator" value="-" /> <!-- 国际化资源文件名 --> <constant name="struts.custom.i18n.resources" value="i18n" /> <!-- 是否自己主动载入国际化资源文件 --> <constant name="struts.i18n.reload" value="true" /> <!-- 浏览器是否缓存静态内容 --> <constant name="struts.serve.static.browserCache" value="false" /> <!-- 上传文件限制大小设置 --> <constant name="struts.multipart.maxSize" value="-1" /> <!-- 主题。将值设置为simple,即不使用UI模板。这将不会生成额外的html标签 --> <constant name="struts.ui.theme" value="simple" /> <!-- 编码格式 --> <constant name="struts.i18n.encoding" value="UTF-8" /> <!-- 自己主动载入xml配置不用重新启动tomcat --> <constant name="struts.configuration.xml.reload" value="true" /> </struts>


原文地址:https://www.cnblogs.com/mthoutai/p/6738336.html