Tomcat设置80端口后,网页不能访问

来源:互联网 发布:魔兽单机版端口80 编辑:程序博客网 时间:2024/06/01 10:05

随笔,记录下解决过程

出现问题后,对下列进行了排查。

1、用端口查看工具,发现80端口未被占用。

2、服务器是Windows2008, 对80端口没有任何权限、防火墙设置的地方。

3、使用TCP客户端工具,连接80端口,发现能回网页。

解决:

问题出在jsp代码上:

原来错误写法:

<%

 String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";

%>

<script type="text/javascript">

 var basePath = '<%=basePath%>';

 if (window.location.href  != basePath+"login.jsp") window.location.href = basePath+"login.jsp"

</script>

当IE用80端口访问时,window.location.href是不含端口信息的,所以上述代码错误。

阅读全文
0 0