Spring mvc 同类之间方法的互相跳转 "redirect:/manage/ManageUser";

package xxx.xxx.xxxx.controller;

@Controller
@RequestMapping("/manage")
public class TestJavaRedirectController {

    @RequestMapping("/ManageUser")
    public String redirectTo()
    {
        System.out.println("username");
    }

 @RequestMapping("/to")
    public String redirectTo()
    {
        return "redirect:/manage/ManageUser";  
    }
}

其中方法也可以带参数:如"redirect:/manage/ManageUser?username=";  

posted @ 2017-03-03 17:08  Ming明  阅读(260)  评论(0编辑  收藏  举报