菜鸟4547 2014-06-06 06:17 采纳率: 0%
浏览 6165

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

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥20 simulink中怎么使用solve函数?
    • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
    • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
    • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
    • ¥15 知识蒸馏实战博客问题
    • ¥15 用PLC设计纸袋糊底机送料系统
    • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
    • ¥15 用C语言输入方程怎么
    • ¥15 网站显示不安全连接问题
    • ¥15 51单片机显示器问题