【问题标题】:Spring mvc redirect the same url to different hostsSpring mvc 将相同的 url 重定向到不同的主机
【发布时间】:2018-06-27 08:29:29
【问题描述】:

现在有两个不同的域名 a.comb.com 绑定到同一个 IP。当我使用a.com/xxx进入控制器执行重定向操作时,会跳转到b.com/test。为什么会这样?

Controller.java:

@RequestMapping("/xxx")
public String campFinish() {
    //do something
    return "redirect/test";
}

@RequestMapping("/test")
public String campFinish() {
    //do something
    return "some page";
}

【问题讨论】:

    标签: spring spring-mvc url redirect


    【解决方案1】:

    首先是redirect:/test。但是,您的问题与 Spring 无关。它与您的 dns 配置有关。第一个获得解析的域名将出现。它是 b.coma.com

    【讨论】:

      猜你喜欢
      • 2017-08-12
      • 2019-08-20
      • 2020-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-25
      相关资源
      最近更新 更多