SpringMVC使用ModelAndView 跳转第三方url

1.SpringMVC使用ModelAndView 跳转第三方url

代码如下(示例):

@RequestMapping(value = "/goToWcyAIClinical", method = RequestMethod.GET)
    public ModelAndView goToWcyAIClinical(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        ModelAndView mv = new ModelAndView();
        Person person = CurrentUser.getCurrentPerson();
        if (null == person) {
            return gotoNoScopePage(mv);//跳转person为空处理页面
        }
        //设置用户参数
        String personID = person.getPersonID();
        String companyID = person.getCompanyID();
        return new ModelAndView(new RedirectView("http://www.baidu.com?personId="+personID+"&companyID="+companyID));
    }

参考文档
https://blog.csdn.net/ljy950914/article/details/100074296

你可能感兴趣的:(java)