与第三方网址集成时,ERR_TOO_MANY_REDIRECTS

时间:2018-11-14 08:25:27

标签: html servlets

这是一个特定的问题。对于以下URL(实际上是IBM LSF PAC) http://domain:8080/platform/j_spring_security_check?j_username=lsfadmin&j_password=Pass1234

我可以通过将其粘贴到地址栏来打开它(登录到应用程序)。要在下面的本地中创建HTML文件,请打开它,然后单击链接: test lsf pac 也可以。

<html>
<a href="http://domain:8080/platform/j_spring_security_check?j_username=lsfadmin&j_password=Pass1234" target="_blank">test lsf pac</a>
</html>

但是,如果我将文件放在服务器端(例如tomcat),则在单击chrome中的链接并将地址栏中的网址最终更改为http://domain:8080/platform/framework/logout/logout.action?csrftoken=74467be7-6d81-4347-859e-ec70f4ecd25c后,我会得到标题错误。

然后,我编写了一个servlet来重定向url(假设上下文根是sdemo,路径是/ welcome来映射servlet):

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {   
    response.sendRedirect("http://domain:8080/platform/j_spring_security_check?j_username=lsfadmin&j_password=Pass1234");       
}

http://localhost:8080/sdemo/welcome(hit(位于地址栏中)可以到达servlet并成功重定向到目标应用程序。

但是,如果创建一个页面,在其中使用javascript ( window.open("the url") )/hyper link指向该servlet,我仍然会得到ERR_TOO_MANY_REDIRECTS

上述情况发生在chrome / ff(最新版本)上。

然后我尝试在IE(9/10/11)中对其进行测试,这是更好的选择,或者甚至是{strong>甚至很奇怪,但是window.open("the servlet url/or the target link")可以工作,不起作用(错误:无法搜索页面,请确保网址http://domain:8080正确)。

我对此很费劲。这是“域”服务器中的配置吗?或者我可以用代码修复此问题以使其在浏览器中都能正常工作?

0 个答案:

没有答案