struts.properties
struts.properties是Struts 2非常重要的一个文件,下面分别介绍其中一些参数的作用。
指定加载Struts 2配置文件管理器,默认为org.apache.struts2.config.DefaultConfiguration。
-
#struts.configuration=org.apache.struts2.config.DefaultConfiguration
设置默认的locale和字符编码。
-
#struts.locale=en_US
-
struts.i18n.encoding=UTF-
8
指定Struts的工厂类。
-
#struts.objectFactory=spring
指定Spring框架的装配模式。
-
struts.objectFactory.spring.autoWire=name
该属性指定整合Spring时,是否对Bean进行缓存,值为true或false,默认为true。
-
struts.objectFactory.spring.useClassCache=
true
指定类型检查:
-
#struts.objectTypeDeterminer=tiger
-
#struts.objectTypeDeterminer=notiger
该属性指定处理 MIME类型multipart/form-data,文件上传。
-
#struts.multipart.parser=cos
-
#struts.multipart.parser=pell
-
struts.multipart.parser=jakarta
指定上传文件时的临时目录,默认使用 javax.servlet.context.tempdir。
-
struts.multipart.saveDir=
-
struts.multipart.maxSize=
2097152
加载自定义属性文件。
-
#struts.custom.properties=application,
org/apache/struts2/extension/custom
指定请求URL与Action映射器,默认为org.apache.struts2.dispatcher.mapper.Default
-
ActionMapper。
-
#struts.mapper.
class
=org.apache.struts2.
dispatcher.mapper.DefaultActionMapper
指定Action的后缀,默认为action。
-
struts.action.extension=action
指定浏览器是否缓存静态内容,测试阶段设置为false,发布阶段设置为true。
-
struts.serve.
static
.browserCache=
true
设置是否支持动态方法调用,true为支持,false不支持。
-
struts.enable.DynamicMethodInvocation=
true
设置是否可以在Action中使用斜线,默认为false不可以,想使用需设置为true。
-
struts.enable.SlashesInActionNames=
false
是否允许使用表达式语法,默认为true。
-
struts.tag.altSyntax=
true
设置当struts.xml文件改动时,是否重新加载。
-
struts.configuration.xml.reload=
true
设置Struts是否为开发模式,默认为false,测试阶段一般设为true。
-
struts.devMode=
false
设置是否每次请求都重新加载资源文件,默认为false。
-
struts.i18n.reload=
false
标准的UI主题,默认的UI主题为xhtml,可以为simplexhtml或ajax。
-
struts.ui.theme=xhtml
模板目录。
-
struts.ui.templateDir=template
设置模板类型,可以为 ftl、vm、jsp。
-
struts.ui.templateSuffix=ftl
定位velocity.properties 文件,默认为velocity.properties。
-
struts.velocity.configfile=velocity.properties
设置Velocity的Context。
-
struts.velocity.contexts=
定位ToolBox。
-
struts.velocity.toolboxlocation=
指定Web应用的端口。
-
struts.url.http.port=
80
指定加密端口。
-
struts.url.https.port=
443
设置生成URL时是否包含参数,值可以为none、get或all。
-
struts.url.includeParams=get
设置要加载的国际化资源文件,以逗号分隔。
-
#struts.custom.i18n.resources=testmessages,testmessages2
对于一些Web应用服务器不能处理HttpServletRequest.getParameterMap(),像 WebLogic、Orion和OC4J等,需设置成true,默认为false。
-
struts.dispatcher.parametersWorkaround=
false
指定FreeMarker管理器。
#struts.freemarker.manager.classname=org.apache.struts2.views.freemarker.FreemarkerManager
设置是否对FreeMarker模板设置缓存,效果相当于把Template复制到WEB_APP/templates。
-
struts.freemarker.templatesCache=
false
通常不需要修改此属性。
-
struts.freemarker.wrapper.altMap=
true
指定样式表是否使用缓存,开发阶段设为true,发布阶段设为false。
-
struts.xslt.nocache=
false
设置Struts自动加载的文件列表。
-
struts.configuration.files=struts-
default
.xml,
struts-plugin.xml,struts.xml
设置是否选择最后一个斜杠前的namespace。
-
struts.mapper.alwaysSelectFullNamespace=
false
分享到:
相关推荐
The org.apache.struts2.config.Configuration implementation class org.apache.struts2.config.Configuration接口名 struts.configuration.files A list of configuration files automatically loaded by ...
详尽的struts2的struts.properties各个属性介绍
struts2的struts.properties配置文件详解
详细介绍struts2中的properties文件一些配置项的含义
NULL 博文链接:https://wellfrog.iteye.com/blog/612014
一个非常详细的struts.properties文件,一看就明白.
struts.properties详解,每一行都给注释了,值得你一看哦
自己学会的,保存的学习网页,给大家分享 struts2 国际化
本书内容非常全面,涵盖了众多书籍所有知识要点,并结合作者自己经验总结而编写,内容相当丰富,是查找技术的好帮手及学习Struts2的不二选择 众所周知,一般书籍为了销售需要,往往很少的知识点,却需要添加大量的...
Struts 2 properties文件详解
sturts2的配置文件 struts.properties配置详解
该属性的默认值为velocity.properties. struts.velocity.contexts 该属性指定Velocity框架的Context位置,如果该框架有多个Context,则多个Context之间以英文逗号(,)隔开. struts.velocity.toolboxlocation 该属性...
通过 struts.xml、struts.properties 或 web.xml 改变 struts.convention.default.parent.package 常量的值,让支持 REST 风格的 Action 所在的包默认继承 rest-default,而不是继承默认的 convention-default 父包...
(3).struts.properties(参default.properties) 4 (4)struts-default.xml 4 (5)其它配置文件 4 4.让MyEclipse提示xml信息 4 5.如何使用alt+/提示 4 6.实例 4 7.开启struts2自带的开发模式常量 6 8.vo传参...
解决Struts中ApplicationResources.properties文件不支持中文问题
truts.xml_struts.properties_详解共6页.pdf.zip
有关struts2下载组件的具体介绍我就在此略过了,看此文的同志想必大多是碰到这样让人很是不爽的问题。 下面就将该问题的最终解决办法介绍如下。 问题概要: 在struts2中使用result里type="stream"的结果类型时,...