请求转到Struts Dispatcher
我配置了Struts 2和Spring MVC。 我的web.xml
如下所示。 当我点击REST URL上传文件时,它会调用struts调度程序而不是Spring。
URL /rest/uploadfile/iec9.pdf
将转到Struts Dispatcher
struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* springmvc-dispatcher org.springframework.web.servlet.DispatcherServlet 1 springmvc-dispatcher /rest/* contextConfigLocation /WEB-INF/springmvc-dispatcher-servlet.xml org.springframework.web.context.ContextLoaderListener jsonpCallbackFilter org.springframework.web.filter.DelegatingFilterProxy jsonpCallbackFilter *.json
您的spring MVC调度程序servlet映射到Strutsfilter处理的URL子集。 对于在任何其他servlet之前调用的filter,它将具有优先权。 要解决此问题,您需要配置Struts以从映射中排除某些URL。
...