试图从控制器方法重定向到另一个控制器,面向下面误差请求方法“GET”不支持
org.springframework.web.HttpRequestMethodNotSupportedException:请求方法“GET”不支持
我有在控制器1 submitForm方法中,一旦调用我提交方法应该调用控制器2
控制器1
@RequestMapping(method = RequestMethod.POST)
public ModelAndView submitForm(@ModelAttribute("loginForm") Login login, BindingResult errors, SessionStatus status, HttpServletRequest request, HttpServletResponse response) throws IOException {
return new ModelAndView("path2.sp");
}
控制器2
@Controller
@RequestMapping("path2.sp")
public class DestinationController {
System.out.println("");
}
你要调用get方法,但在你的控制器,你有只发布 –
'DestinationController'甚至没有从'submitForm'方法接收重定向调用的方法。在'DestinationController'中创建一个可以接收请求调用的方法。 –
我想收到课堂级别的请求 – Anamika