Spring MVC 如何跳转项目以外的地址?

Summer_東 2015-07-31 09:50:25
@RequestMapping(produces = "select")
private String getPid(ProductCatalogEntity bean, Model model,HttpServletResponse response) {
boolean pid = productCatalogService.getPid(bean, model);
if(pid){
//return "Info.jsp";
// return new ModelAndView("redirect:/http://192.168.1.115:8090/jeeshop/product/10321.html");
return "redirect:/http://192.168.1.115:8090/jeeshop/product/10321.html"; 要跳转的地址

}
return null;
}
试了很多方法都没解决 跳转的总是当前项目下的地址,求大神解决 还需要带参数跳转
...全文
4729 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
陈舍鱼 2016-08-23
  • 打赏
  • 举报
回复
引用 3 楼 Inhibitory 的回复:
"redirect:/http://192.168.1.115:8090/jeeshop/product/10321.html" 多了一个 / 应该是: "redirect:http://192.168.1.115:8090/jeeshop/product/10321.html"
三楼高手
Inhibitory 2015-07-31
  • 打赏
  • 举报
回复
"redirect:/http://192.168.1.115:8090/jeeshop/product/10321.html" 多了一个 / 应该是: "redirect:http://192.168.1.115:8090/jeeshop/product/10321.html"
gukuitian 2015-07-31
  • 打赏
  • 举报
回复
试试 @RequestMapping(produces = "select") private void getPid(ProductCatalogEntity bean, Model model,HttpServletResponse response) { response.sendRedirect(url); }
迷林 2015-07-31
  • 打赏
  • 举报
回复
如果是在同一工程的项目 就不用那么麻烦,直接返回“10321.html“页面

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧