@RequestMapping(value = "/login/{id}", method = RequestMethod.GET)
public String doLogin(@PathVariable long id, HttpServletRequest request, HttpServletResponse response, Model model) {
logger.info(String.format(
Constants.LogMessages.NEW_GET_REQUEST_FROM_IP,
request.getRemoteAddr()));
logger.info("/login/{id}");
return "login";
}
和我appServlet-context.xml中:
的例外,我在这个方法得到的是:
WARN PageNotFound - No mapping found for HTTP request with URI [/project/WEB-INF/views/login.html] in DispatcherServlet with name 'appServlet'
事情是,当我将“后缀”更改为.jsp和文件的名称从HTML到.jsp它的作品。
有什么想法为什么?
编辑:
这里是我的web.xml:
contextConfigLocation
/WEB-INF/spring/root-context.xml
org.springframework.web.context.ContextLoaderListener
appServlet
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/spring/appServlet/servlet-context.xml
1
appServlet
/
cors
src.com.project.context.CorsFilter
cors
/*
2013-08-23
Urbanleg
+0
项目是否存在文件'/项目/ WEB-INF /视图/ login.html'? –
+0
是文件存在。 –
+0
您可以在web.xml中显示DispatcherServlet的配置。 –