axis2和struts在整合过程中,struts会把axis的地址也拦截了,默认当成一个action处理,
会因为找不到action而报错;
<!-- struts配置 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- axis配置 -->
<servlet>
<servlet-name>AxisServlet</servlet-name>
<servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
两种解决办法:
一.在struts.xml配置文件中加入排除过滤的地址
<constant name="struts.action.excludePattern" value="/services.*"/>
value中的“.”符号是必须的,如过滤地址为 “/services/*” value必须配置为 "/services.*"
二.重写默认struts过滤类
具体步骤可参考这篇文章:http://blog.csdn.net/lishengbo/article/details/5474044