SpringMVC重定向与转发
重定向 , 不需要视图解析器 , 本质就是重新请求一个新地方嘛 , 所以注意路径问题.
@Controller
public class ResultSpringMVC2 {
	@RequestMapping("/rsm2/t1")
	public String test1(){
		//转发
		return "test";
	}
	
	@RequestMapping("/rsm2/t2")
	public String test2(){
		//重定向
		return "redirect:/index.jsp";
		//return "redirect:hello.do"; //hello.do为另一个请求/
	}
}
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号