一个项目的欢迎页面往往是在web.xml中用标签<welcome-file-list>设置
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
但在Struts 2 中通常建议在struts.xml中配置欢迎页,使用标签<default-action-ref>即可。代码如下:
<struts>
<package name="hello" extends="struts-default" namespace="/">
<default-action-ref name="index"></default-action-ref>
<action name="index">
<result>/index.jsp</result>
</action>
</package>
</struts>