用sturts2写一个增删改查,列表页面的值取不到。用sturt2标签。

解决方案 »

  1.   

    可以參考這篇喔
    [Struts2] Struts2 Data Tags
    http://silver8250.blogspot.com/2009/05/struts2-struts2-data-tags.html
      

  2.   

    建议直接去struts2官网去看文档,下载sample运行,基本上什么都有了。
      

  3.   

    首先感谢各位回帖!zhouyusunquan你有什么资料,可以发给我哦。谢谢!
      

  4.   

    你到apatch的官网上去看下文档就知道怎么做了,写的很详细的
      

  5.   

    列表娶不到值?你可以用struts标签中的iterator啊,遍历后台放到request的集合。
    request.setAtrebut("list",list);红色的是你从数据库中查到某个对象的集合。
    在页面中
    <s:iterator value="#request.list" var="variable">
    <s:properties value="#variable.username">
    <s:properties value="#variable.password">
    <s:properties value="#variable.id">
    <s:properties value="#variable.address">
    。。
    </s:iterator>
      

  6.   

    请注意,struts2中的值栈和request中数据的使用区别。
    The Action instance is always pushed onto the value stack. Because the Action is on the stack, and the stack is the OGNL root, references to Action properties can omit the # er. But, to access other objects in the ActionContext, we must use the # notation so OGNL knows not to look in the root object, but for some other object in the ActionContext.具体请看官方文档……
      

  7.   

    参考:http://wl-ldy.iteye.com/admin/categories/138675