我使用Hiebernate+Struts2.0
如果要读取内容的话 要调用Action读取数据库
然后在页面中通过<s:iterator>读取Action调用的信息
但是在首页中要怎么读取呢在网上搜索有几种方案1.修改web.xml
<welcome-file-list>
 <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
好像说是修改成index.action类似这样的 来调用Action2.在打开index.jsp就直接跳转到Action,通过这样来读取数据库3.就是用Javabean来调用dao读取不知道哪种方案比较适合,大家有好的方案可以分享下
学习学习

解决方案 »

  1.   

    <body>
    <script type="text/javascript">
    var url = "<%=path%>/boardAction.do?method=list";
    window.location.href = url;
    </script>
    </body>
    或者用iframe都可以
      

  2.   

    可以这样,index.jsp中<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <c:redirect url="/XXX.action"/>
      

  3.   

    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <c:redirect url="/XXX.action"/>
    这种可行
      

  4.   

    谢谢大家了 我用了<s:action>这个标签 很不错呀!