【发布时间】:2014-07-14 14:52:15
【问题描述】:
我正在尝试在运行在 tomcat 上的 servlet 中使用 response.sendRedirect,该 servlet 从 apache 服务器接收来自浏览器的请求。因此,任何重定向都会将 url 的 'ip.ip.ip.ip' 或 'someurl.com' 部分替换为 'localhost:8080' (据我所知,这是因为 tomcat 将请求源标识为 apache 服务器地址) . request.getRequestURL也受到这个问题的影响。有没有什么办法可以解决这个问题,而无需编写响应实际上应该进行重定向的 javascript 块?
【问题讨论】:
-
显示重定向代码。