您的位置:首页 > 大数据 > 人工智能

http://localhost:8080/main.do?action=index改成http://localhost:8080/来访问首页

2014-07-16 10:18 627 查看
web.xml

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

index.jsp:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Loading...</title>
<script language="javascript" type="text/javascript">
window.location.href="main.do?action=index";
</script>
</head>
<body>
</body>
</html>

访问首页路径:http://localhost:8080/main.do?action=index

需要访问首页的时候,直接用  :http://localhost:8080/

解决方案:修改index.jsp

<jsp:forward page="/egmain.egov?action=index"></jsp:forward>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Loading...</title>
<script language="javascript" type="text/javascript">
//window.location.href="egmain-index.html"; //此处用jsp:forward 动态跳转命令
</script>
</head>
<body>
</body>
</html>


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐