struts2的struts.properties配置文件详解

本文详细介绍了Struts2框架中的各种配置选项,包括URL扩展名、国际化资源文件位置、开发模式开关等,帮助开发者更好地理解和定制Struts2应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

struts.action.extension

TheURLextensiontousetodetermineiftherequestismeantforaStrutsaction

用URL扩展名来确定是否这个请求是被用作Strutsaction,其实也就是设置action的后缀,例如login.do的/'do/'字。

struts.configuration

Theorg.apache.struts2.config.Configurationimplementationclass

org.apache.struts2.config.Configuration接口名

struts.configuration.files

AlistofconfigurationfilesautomaticallyloadedbyStruts

struts自动加载的一个配置文件列表

struts.configuration.xml.reload

WhethertoreloadtheXMLconfigurationornot

是否加载xml配置(true,false)

struts.continuations.package

ThepackagecontainingactionsthatuseRifecontinuations

含有actions的完整连续的package名称

struts.custom.i18n.resources

Locationofadditionallocalizationpropertiesfilestoload

加载附加的国际化属性文件(不包含.properties后缀)

struts.custom.properties

Locationofadditionalconfigurationpropertiesfilestoload

加载附加的配置文件的位置

struts.devMode

WhetherStrutsisindevelopmentmodeornot

是否为struts开发模式

struts.dispatcher.parametersWorkaround

WhethertouseaServletrequestparameterworkaroundessaryforsomeversionsofWebLogic

(某些版本的weblogic专用)是否使用一个servlet请求参数工作区(PARAMETERSWORKAROUND)

struts.enable.DynamicMethodInvocation

AllowsonetodisabledynamicmethodinvocationfromtheURL

允许动态方法调用

struts.freemarker.manager.classname

Theorg.apache.struts2.views.freemarker.FreemarkerManagerimplementationclass

org.apache.struts2.views.freemarker.FreemarkerManager接口名

struts.i18n.encoding

Theencodingtouseforlocalizationmessages

国际化信息内码

struts.i18n.reload

Whetherthelocalizationmessagesshouldautomaticallybereloaded

是否国际化信息自动加载

struts.locale

ThedefaultlocalefortheStrutsapplication

默认的国际化地区信息

struts.mapper.class

Theorg.apache.struts2.dispatcher.mapper.ActionMapperimplementationclass

org.apache.struts2.dispatcher.mapper.ActionMapper接口

struts.multipart.maxSize

Themaximizesizeofamultipartrequest(fileupload)

multipart请求信息的最大尺寸(文件上传用)

struts.multipart.parser

Theorg.apache.struts2.dispatcher.multipart.

MultiPartRequestparserimplementationforamultipartrequest(fileupload)

专为multipart请求信息使用的org.apache.struts2.dispatcher.multipart.MultiPartRequest解析器接口(文件上传用)

struts.multipart.saveDir

Thedirectorytouseforstoringuploadedfiles

设置存储上传文件的目录夹

struts.objectFactory

Thecom.opensymphony.xwork2.ObjectFactoryimplementationclass

com.opensymphony.xwork2.ObjectFactory接口(spring)

struts.objectFactory.spring.autoWire

WhetherSpringshouldautoWireornot

是否自动绑定Spring

struts.objectFactory.spring.useClassCache

WhetherSpringshoulduseitsclasscacheornot

是否spring应该使用自身的cache

struts.objectTypeDeterminer

Thecom.opensymphony.xwork2.util.ObjectTypeDeterminerimplementationclass

com.opensymphony.xwork2.util.ObjectTypeDeterminer接口

struts.serve.static.browserCache

IfstaticcontentservedbytheStrutsfiltershouldsetbrowsercachingheaderpropertiesornot

是否struts过滤器中提供的静态内容应该被缓存在头部属性中

struts.serve.static

WhethertheStrutsfiltershouldservestaticcontentornot

是否struts过滤器应该提供静态内容

struts.tag.altSyntax

Whethertousethealterativesyntaxforthetagsornot

是否可以用替代的语法替代tags

struts.ui.templateDir

ThedirectorycontainingUItemplates

UItemplates的目录夹

struts.ui.theme

ThedefaultUItemplatetheme

默认的UItemplate主题

struts.url.http.port

TheHTTPportusedbyStrutsURLs

设置http端口

struts.url.https.port

TheHTTPSportusedbyStrutsURLs

设置https端口

struts.url.includeParams

ThedefaultincludeParamsmethodtogenerateStrutsURLs

在url中产生默认的includeParams

struts.velocity.configfile

TheVelocityconfigurationfilepath

velocity配置文件路径

struts.velocity.contexts

ListofVelocitycontextnames

velocity的context列表

struts.velocity.manager.classname

org.apache.struts2.views.velocity.VelocityManagerimplementationclass

org.apache.struts2.views.velocity.VelocityManager接口名

struts.velocity.toolboxlocation

ThelocationoftheVelocitytoolbox

velocity工具盒的位置

struts.xslt.nocache

WhetherornotXSLTtemplatesshouldnotbecached

是否XSLT模版应该被缓存

例如:

struts.i18n.reload=true

struts.devMode=true

struts.configuration.xml.reload=true

struts.continuations.package=org.apache.struts2.showcase

struts.custom.i18n.resources=globalMessages

#struts.action.extension=jspa

struts.url.http.port=8080

struts.freemarker.manager.classname=customFreemarkerManager

struts.serve.static=true

struts.serve.static.browserCache=false

struts.codebehind.defaultPackage=person

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值