Springmvc登录

转载自:https://blog.csdn.net/caiwenfeng_for_23/article/details/45486233.

spirng mvc 默认index controller 方式 

如果在tomcat容器没有配置默认页面,怎spring mvc 会主动去寻找/index的controller,如果有则会调用,没有则会显示404页面。 
@RequestMapping(value=”/index”) 
public ModelAndView index(HttpServletRequest request, HttpServletResponse response){ 
return new ModelAndView(“index”); 

}


一般登录时都是通过control访问jsp,这样拦截器可以拦截到,第一次进入jsp时,不会经过拦截器

猜你喜欢

转载自blog.csdn.net/m0_37879526/article/details/79876971