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上无效。

Set the configuration
"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.
Struts2部署在IBM WebShpere Application Server v6.1的问题

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

Invoking the filter capability
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.
Name Value
com.ibm.ws.webcontainer.invokeFiltersCompatibility true



你可能感兴趣的:(Web,jsp,servlet,IBM,websphere)