我在项目根目录下有个文件index.xtml,在web.xml 配置了 如下:
<welcome-file-list>
<welcome-file>index.xtml</welcome-file>
</welcome-file-list>index.xtml内容如下:<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script language="javascript">
window.location="/indexWeb.htm";
</script>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
</body>
</html>在IE浏览器下输入http://localhost:8081
可以自动跳到http://localhost:8081/indexWeb.htm
但在火狐浏览器输入http://localhost:8081
显示和index.xtml 一样的内容 根本没有解析,还有就是我直接输入://localhost:8081/index.xtml也是一样没有解析出来
求高手如何解决
急。。谢谢
<welcome-file-list>
<welcome-file>index.xtml</welcome-file>
</welcome-file-list>index.xtml内容如下:<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script language="javascript">
window.location="/indexWeb.htm";
</script>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
</body>
</html>在IE浏览器下输入http://localhost:8081
可以自动跳到http://localhost:8081/indexWeb.htm
但在火狐浏览器输入http://localhost:8081
显示和index.xtml 一样的内容 根本没有解析,还有就是我直接输入://localhost:8081/index.xtml也是一样没有解析出来
求高手如何解决
急。。谢谢
window.location="/indexWeb.htm";这个有错
改成window.location.href="/indexWeb.htm";看下
<%@ page contentType="text/html; charset=utf-8" %>
删了吧,这是jsp的标签不是html的
1、window.location="${pageContext.request.contextPath }/indexWeb.htm";
2、<jsp:forward page="indexWeb.htm"></jsp:forward>