struts2 Action的生命周期是多少?同在一个action里面的jsp,,这些jsp都可以共享action的数据吗?
所有的jsp都提交给这个xxxAction.action,
a.jsp提交给这个xxxAction.action(同时,action设置了一些数据k)
这个action return不同的路径到另外的b.jsp,
b.jsp再提交给xxxAction.action,(同时,action设置了一些数据j)
这个action return不同的路径到另外的c.jsp,a.jsp,b.jsp,c.jsp都可以共享action中的数据吗?是指不同时期设置的数据如k,j数据
什么时间action消亡呢?
谢谢

解决方案 »

  1.   

      请问那个struts2 <s:select/> 标签是怎么解决
    Action中有个
    private List<User> userList;user.setUserId(i+"i");
    user.setEmail(i+"@user.com");userList.add(user);
    jsp中:
    <s:select label="test" name="test"list="${userList}" listKey="email" listValue="userId" required="true"  />提示错误:tag 'select', field 'list', name 'assignEditor': The requested list key
    '$userList' could not be resolved as a collection/array/map/enumeration/iterator
    type. Example: people or people.{name} - [unknown location]javax.servlet.ServletException: tag 'select', field 'list', name 'assignEditor':
    The requested list key '$userList' could not be resolved as a collection/array/map/enumeration/iterator
    type. Example: people or people.{name} - [unknown location]
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:518)
    谢谢解答!
      

  2.   

    都是Action中的内容
    为什么{doc.docId}用$
    list,userList用%,也可以不加%
    %,$,#什么关系?
    http://topic.csdn.net/u/20080901/16/b5786bbd-878f-4ae8-942a-5c73e20834df.html
    **********************************糊涂了*********************************************
       <s:iterator value="list" status="status" id="doc">
           <s:checkbox  name="docIDList" value="false" fieldValue="${doc.docId}"></s:checkbox>
    A:--<s:property value="authorId"/>     +T:--<s:property value="docTitle"/>
        </s:iterator>
    <s:select label="assignEditor" name="assignEditor" headerKey="" list="%{userList}" listKey="nameCn" required="true"  listValue="userId" tooltip="Choose Editor"/>
      

  3.   

    官方文档上说,Struts2.0每次请求实例化一个Actio,因此是线程安全的,
    在高并发的程序中有明显优势
      

  4.   

    <s:select 
    tooltip="选择仓库"
    label="仓库"
    list="packHouseList"
    name="packHouse.storageId"
    listKey="storageId" 
    listValue="storageName"
    headerKey="-1" 
    headerValue="--请选择仓库--"
    /><br/>我在我的毕业设计上这样显示我list内容的。
    直接用struts2容器来获取内容。
      

  5.   

    struts2 Action的生命周期
    可以参考这位同学的理解
    http://blog.csdn.net/wxy_G/archive/2008/01/29/2071662.aspx