1. 程式人生 > >控制層跳轉:1)調用別人接口;2)指定頁面

控制層跳轉:1)調用別人接口;2)指定頁面

clas pin except ring void .get string 指定 test

RESTFul 接口中調用重定向到指定 url

    @RequestMapping(value = "sso", method = RequestMethod.GET)
    public void sso(HttpServletRequest request, HttpServletResponse response) throws IOException {
        List<Users> users = usersService.findUsers("loginName", "testuser1");
        Users user = users.get(0);
        String url 
= "http://10.92.2.146/user/signin"; url = String.format("%s?account=%s&password=%s", url, user.getLoginName(), user.getPassword()); response.sendRedirect(url); }

控制層跳轉:1)調用別人接口;2)指定頁面