配置了视图解析器之后,如何跳到初始的index.jsp

方法1:

@RequestMapping("/returnIndex")
public String returnIndex(){
    
    
    return "redirect:/index.jsp";
}

方法2

@RequestMapping("/returnIndex2")
public void returnIndex2(HttpServletResponse response) throws Exception{
    
    
    response.sendRedirect("/index.jsp");
}

猜你喜欢

转载自blog.csdn.net/qq_40622253/article/details/109232160