struts2
<filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping>
welcome-file-list
<welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list>
index.jsp
<%--<jsp:forward page="${pageContext.request.contextPath}/index-init.action" /> --%> <meta http-equiv='refresh' content='0;url=${pageContext.request.contextPath}/index-init.action'>
在jsp文件中的两种方式选一即可