未找到具有 URI 的 HTTP 请求的映射 - 在 spring 3.2.4 中
No mapping found for HTTP request with URI - in spring 3.2.4
我有这个控制器:
...
@RequestMapping(value = "/accounts/manageaccount.do", method = RequestMethod.GET)
public String initForm(HttpServletRequest request, Model model) {
model.addAllAttributes(getModel(request));
return "registerAccountView";
}
@RequestMapping(value = "/accounts/saveaccount.do", method = RequestMethod.POST)
public String saveaccount(HttpServletRequest request, Model model) {
model.addAllAttributes(getModel(request));
return "registerAccountView";
}
...
当我把这个 URL 放在浏览器中时,控制器的映射很好
http://127.0.0.1:7001/devices/accounts/manageaccount.do
那我有这个jsp
<form method="post" action="saveaccount.do">
</form>
但是当我提交时出现了这个奇怪的错误
URL: /devices/accounts/saveaccount.do
???error404.error???
确保您的 web-xml 中的 servlet 映射配置为处理 .do
请求:
<servlet-mapping>
<servlet-name>yourServletName</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
我有这个控制器:
...
@RequestMapping(value = "/accounts/manageaccount.do", method = RequestMethod.GET)
public String initForm(HttpServletRequest request, Model model) {
model.addAllAttributes(getModel(request));
return "registerAccountView";
}
@RequestMapping(value = "/accounts/saveaccount.do", method = RequestMethod.POST)
public String saveaccount(HttpServletRequest request, Model model) {
model.addAllAttributes(getModel(request));
return "registerAccountView";
}
...
当我把这个 URL 放在浏览器中时,控制器的映射很好
http://127.0.0.1:7001/devices/accounts/manageaccount.do
那我有这个jsp
<form method="post" action="saveaccount.do">
</form>
但是当我提交时出现了这个奇怪的错误
URL: /devices/accounts/saveaccount.do
???error404.error???
确保您的 web-xml 中的 servlet 映射配置为处理 .do
请求:
<servlet-mapping>
<servlet-name>yourServletName</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>