2 wulongfei 0813 wulongfei_0813 于 2014.06.06 14:17 提问

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

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!