问题描述
- SpringMVC页面跳转问题,求解答。
-
@RequestMapping("/test/test.do")
public ModelAndView test(HttpServletRequest req, HttpServletResponse resp){
ModelAndView mav= new ModelAndView();
mav.addObject("message", "Hello World!");mav.setViewName("loginSuccess"); return mav; }
代码执行完成Debug没有报错为什么页面不跳转呢?
14:18:26.998 [http-bio-8080-exec-18] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'spring' processing POST request for [/SpringMVC/test/test.do]
14:18:26.998 [http-bio-8080-exec-18] DEBUG o.s.w.s.m.a.DefaultAnnotationHandlerMapping - Mapping [/test/test.do] to handler 'com.mvc.action.StudentAction@23bffd0d'
14:18:26.999 [http-bio-8080-exec-18] DEBUG o.s.w.b.a.s.HandlerMethodInvoker - Invoking request handler method: public org.springframework.web.servlet.ModelAndView com.mvc.action.StudentAction.test(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
14:18:26.999 [http-bio-8080-exec-18] DEBUG o.s.web.servlet.DispatcherServlet - Rendering view [org.springframework.web.servlet.view.JstlView: name 'loginSuccess'; URL [/jsp/loginSuccess.jsp]] in DispatcherServlet with name 'spring'
14:18:27.000 [http-bio-8080-exec-18] DEBUG o.s.web.servlet.view.JstlView - Added model object 'message' of type [java.lang.String] to request in view with name 'loginSuccess'
14:18:27.000 [http-bio-8080-exec-18] DEBUG o.s.web.servlet.view.JstlView - Forwarding to resource [/jsp/loginSuccess.jsp] in InternalResourceView 'loginSuccess'
14:18:27.000 [http-bio-8080-exec-18] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request