有时候我们在加载首页时就要用到数据库的数据,也即是action的返回的数据。
可以有如下方式:
1.建个空的jsp页面,页面内容
<% response.sendRedirect("xxx.action"); //就这样一句话!%>
然后在web.xml中配置:
<welcome-file-list>
<welcome-file>这里就是你的jsp文件</welcome-file>
</welcome-file-list>
2.在WEB-ROOT下建个空文件文件名就是你的action的名字(像这样xxx.action作为文件名)
-
<welcome-file-list>
-
<welcome-file>xxx.action</welcome-file>
-
</welcome-file-list>