springMVC 想在controller 中进行前台页面跳转,这个怎么解决的

2025-01-24 13:55:59
推荐回答(1个)
回答1:

@RequestMapping(value = "/page", method = RequestMethod.GET)
public ModelAndView pageGet() {
return new ModelAndView("page");
}

@RequestMapping(value = "/page", method = RequestMethod.GET)
public ModelAndView pageGet() {
return new ModelAndView("redirect:"+page);
}

你要是配置好的话这么写就行,跳到page.jsp或是你配置的,这俩跳转的区别你试下就知道了