Struts2部署在IBM WebShpere Application Server v6.1的问题

要将Struts2部署到WAS上,需要在WAS上添加一个参数com.ibm.ws.webcontainer.invokeFiltersCompatibility=true.

默认情况下,WAS是不处理用户自定义的filter中的URI映射,而Struts2需要org.apache.struts2.dispatcher.FilterDispatcher拦截所有的请求并且处理Struts2标签。所以不作处理的话你会发现Struts2的项目发布在WAS上无效。

[b]Set the configuration [/b]
"com.ibm.ws.webcontainer.invokefilterscompatibility=true" at first and then restart the server.
1.Administrative Console -> Servers -> Application Servers -> [ServerName] -> Configuration -> Container Settings -> Web Container Settings -> Web Container -> Configuration -> Additional Properties -> Custom Properties
Add property "com.ibm.ws.webcontainer.invokefilterscompatibility" with value "true"
2. Restart the server for the custom property to take effect.
[img]http://dl.iteye.com/upload/attachment/295649/8423091c-8421-3645-8849-fb1acb3f964c.jpg[/img]

[b]IBM官方网站上的参数说明 [/b]
[url=http://publib.boulder.ibm.com/infocenter/wasinfo/beta/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rweb_custom_props.html]http://publib.boulder.ibm.com/infocenter/wasinfo/beta/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rweb_custom_props.html[/url]

[b]Invoking the filter capability[/b]
You might need use a custom servlet filter with Web applications to map files from a one URI to another URI that points to a particular resource. For example, you might map URIs that start with my_company to the my_company/external directory. Without enabling the com.ibm.ws.webcontainer.invokeFiltersCompatibility custom property, the Web container does not call any custom servlet filters.
With this custom property, the Web container calls custom servlet filters before looking for welcome files. Also, if the Web container cannot find a resource, it calls the custom servlet filters before creating a FileNotFoundException exception. This change enables the Web container to verify whether the custom servlet filters modify the path to a resource.
[table]
|[b]Name[/b]|[b]Value[/b]|
|com.ibm.ws.webcontainer.invokeFiltersCompatibility|true|
[/table]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值