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>