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=";