我正在Tomcat上部署web-app。在IntelliJ的Tomcat7.0.65上部署时,一切正常,当我将它部署在独立的Tomcat服务器7.0.56(XAMPP)上时,当我想点击发送表单时,它会给出状态404响应。另外,我正在使用apache tiles。我的config.xml映射中的所有内容都可以正常工作,只有未在config.xml中映射的请求映射才能正常工作。
你知道如何解决它吗? 我把我的代码放在下面。
RequestMapping不起作用:
@RequestMapping(value = "/add", method = RequestMethod.POST)
public String addNewWorkerButtonClicked(@ModelAttribute("order") OrderEntity newOrder, BindingResult result, SessionStatus status) {
orderService.add(newOrder);
return "redirect:/orders/all";
}
WEB.XML
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/mvc-dispatcher-servlet.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/jpaContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<display-name>Archetype Created Web Application</display-name>
@edit