Struts2常量的具体用法实例 2
- <!-- 设置是否每次请求,都重新加载资源文件,默认值为false. -->
- <cosntant name="struts.i18n.reload" value="false" />
- <!-- 标准的UI主题,默认的UI主题为xhtml,可以为simple,xhtml或ajax -->
- <cosntant name="struts.ui.theme" value="xhtml" />
- <!-- 模板目录 -->
- <cosntant name="struts.ui.templateDir" value="template" />
- <!-- 设置模板类型. 可以为 ftl, vm, or jsp -->
- <cosntant name="struts.ui.templateSuffix" value="ftl" />
- <!-- 定位velocity.properties 文件. 默认velocity.properties -->
- <cosntant name="struts.velocity.configfile" value="velocity.properties" />
- <!-- 设置velocity的context. -->
- <cosntant name="struts.velocity.contexts" value="...." />
- <!-- 定位toolbox -->
- <cosntant name="struts.velocity.toolboxlocation" value="...." />
- <!-- 指定web应用的端口 -->
- <cosntant name="struts.url.http.port" value="80" />
- <!-- 指定加密端口 -->
- <cosntant name="struts.url.https.port" value="443" />
- <!-- 设置生成url时,是否包含参数.值可以为: none,get or all -->
- <cosntant name="struts.url.includeParams" value="get" />
- <!-- 设置要加载的国际化资源文件,以逗号分隔. -->
- <cosntant name="struts.custom.i18n.resources" value="application" />
- <!-- 对于一些web应用服务器不能处理HttpServletRequest.getParameterMap(),
- 像 WebLogic,Orion, and OC4J等,须设置成true,默认为false. -->
- <cosntant name="struts.dispatcher.parametersWorkaround" value="false" />
- <!-- 指定freemarker管理器 -->
- <cosntant name="struts.freemarker.manager.classname" value="org.apache.struts2.views.freemarker.FreemarkerManager" />
- <!-- 设置是否对freemarker的模板设置缓存,效果相当于把template拷贝到 WEB_APP/templates. -->
- <cosntant name="struts.freemarker.templatesCache" value="false" />
- <!-- 通常不需要修改此属性. -->
- <cosntant name="struts.freemarker.wrapper.altMap" value="true" />
- <!-- 指定xslt result是否使用样式表缓存.开发阶段设为true,发布阶段设为false. -->
- <cosntant name="struts.xslt.nocache" value="false" />
- <!-- 设置struts自动加载的文件列表. -->
- <cosntant name="struts.configuration.files" value="struts-default.xml,struts-plugin.xml,struts.xml" />
- <!-- 设定是否一直在最后一个slash之前的任何位置选定namespace. -->
- <cosntant name="struts.mapper.alwaysSelectFullNamespace" value="false" />
- </struts>
本文详细介绍了Struts2框架中的各种配置选项,包括国际化资源文件的加载方式、UI主题的选择、模板目录及类型的设定等内容,并提供了具体的配置示例。
262

被折叠的 条评论
为什么被折叠?



