问题产生的原因:
比如咱们访问的一个网站,然后这个网站的欢迎界面是index.jsp
那么在web.xml中这样配置:
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
但是在跳到这个index.jsp页面的同时,我们还需要通过一个Action从数据库中获取一些必要的数据,
如果在web.xml中这样配置:
<welcome-file-list>
<welcome-file>
xxxxxAction
</welcome-file>
</welcome-file-list>
解决方法:
1.欢迎页面写一个jump.jsp,用于跳转并请求一个Action
<welcome-file-list>
<welcome-file>jump.jsp</welcome-file>
</welcome-file-list>
2.然后在jump.jsp中加入下面这句话:
<meta http-equiv='refresh' content='0;url=xxxAction'>