org.springframework.web.bind.annotation重定向的问题

@Controller
@RequestMapping("/redir")
public class RedirController {
    
    @ResponseBody
    @RequestMapping(value="pay")
    public String redirect(){
        return "redirect:/pay.html";
    }
}
//这种方法无法跳转
@Controller
public class RedirController {

    @RequestMapping(value="/redir/pay")
    public String redirect(){
        return "redirect:/pay.html";
    }
}
//正确跳转方式

猜你喜欢

转载自www.cnblogs.com/zyf-yxm/p/9046079.html
今日推荐