在webx.ml中 配置struts2 后 welcome-file-list 失效的解决办法

时间:2021-10-15 15:14:14

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文件中的两种方式选一即可