struts 配置文件

可以只有一个web.xml,其余都是可选的。

 

File Optional Location (relative to webapp) Purpose
web.xml no /WEB-INF/ Web deployment descriptor to include all necessary framework components
struts.xml yes /WEB-INF/classes/ Main configuration, contains result/view types, action mappings, interceptors, and so forth
struts.properties yes /WEB-INF/classes/ Framework properties
struts-default.xml yes /WEB-INF/lib/struts2-core.jar Default configuration provided by Struts
struts-default.vm yes /WEB-INF/classes/ Default macros referenced by velocity.properties
struts-plugin.xml yes At the root of a plugin JAROptional configuration files for Plugins in the same format as struts.xml.
velocity.properties yes /WEB-INF/classes/ Override the default Velocity configuration

 web.xml


 

配置文件可以自动重载,需要在struts.properties中配置。但是,会有轻微的性能损失

struts.configuration.xml.reload=true

 

struts.xml


可以分割成多个文件片段,如下:

<struts>
    <include file="struts-default.xml"/>
    <include file="config-browser.xml"/>
    <package name="default" extends="struts-default">
....
    </package>
    <include file="other.xml"/>
</struts>

struts-plugin.xml的格式和struts.xml相同

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值