我一直在谷歌上搜索,但我找不到解决方案,所以请告诉我为什么春季前锋不在android api工作,但在web api工作,所以如何解决它?春季前锋不工作在android api
@Controller
@RequestMapping(value = "/")
public class LoginController {
@RequestMapping(method = {RequestMethod.GET,RequestMethod.POST,RequestMethod.HEAD})
public ModelAndView home(@ModelAttribute LoginInfo user, Model model,
HttpServletRequest request, HttpServletResponse response)throws Exception {
System.out.println("LoginController.user.userName: "+userName);
return new ModelAndView("forward:admin.html");
}
@RequestMapping(value = "/admin", method={RequestMethod.GET, RequestMethod.POST})
public ModelAndView successAdmin(@ModelAttribute LoginInfo user, Model model,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
System.out.println("admin.userName: "+userName);
return null;
}
}
我也使用return new ModelAndView(“forward:/admin.html”);但不会将请求转发到/ admin处理程序方法。
可以显示什么是工作,什么是不? – Simon
@Simon实际上请求不是从第一个处理程序方法转发到第二个处理程序方法。 –
当我在web浏览器中打开这个url http:// localhost:8080/SpringMVC /时,然后返回前进正在工作,但是当我从android应用程序中的相同url中打开时,然后在第一个处理程序方法中返回向前不工作。 –