jap使用 ajax 与后台进行数据交互时 web.xml 中 servlet 与 filter 冲突的解决办法

 报错信息为:HTTP Status 404 - There is no Action mapped for namespace / and action name myImageServlet.

发生冲突的原因:struts2把servlet当成action了,因为servlet和action都是没有后缀。此时最简单的方法是在servlet 的 <url-pattern>中给servlet添加后缀,当然在引用时也需把后缀名补上,如图

(添加后缀)

  

(引用)

附上其他博主更多解决方法链接:https://www.cnblogs.com/kabi/p/5182112.html

 -----end------

猜你喜欢

转载自www.cnblogs.com/hyian/p/10748047.html