可以放一个hidden;
或者使用?type="insert"这样,在actionmappings中作为参数传递.

解决方案 »

  1.   

    可以,只要在action中实例化一个dataform,然后把传进来的actionform指针指向这个dataform就行了.
    楼上的type="insert"是什么意思?可以详细说明一下吗?
      

  2.   

    actionform是序列化的,应该可以。不过forword的jsp怎么取得actionform的数据呢?
    一般的数据是通过helper javabean来传递的,两者是不是一样的?
      

  3.   

    实例化form是什么意思阿?是要new一个吗?还有在forward以后的jsp页面显示用什么取formbean的属性值阿?我的例子,请帮我看看
    action类:
    public class SampleAction extends Action 

    public SampleAction() 


    public ActionForward execute(ActionMapping mapping, ActionForm form, 
    HttpServletRequest request, HttpServletResponse response) 

    if(form instanceof SampleForm) 

    SampleForm theForm = (SampleForm)form;  String user = theForm.getThename(); 
    String password = theForm.getThepassword();  request.getSession().setAttribute("user",user);
    request.getSession().setAttribute("password",password); request.setAttribute("thename", user); 
    request.setAttribute("thepassword",password);
     
    return mapping.findForward("play"); 

    else 

    return null; 


    } 下面是forward以后的jsp页面
    <center>
       username:<%=session.getAttribute("user") %>
       password:<%=session.getAttribute("password") %>
      
    <html:form action="modify.do">
        <table align=center cellspacing="1" cellPadding="2">
       <tr >
       <td>the name :</td>
       <td><html:text property="thename" styleClass="box" size="35" /></td>
       </tr>
       <tr >
       <td>the password :</td>
       <td><html:text property="thepassword" styleClass="box" size="15"/></td>
       </tr>
        </table>
    </html:form>
    <hr>
    <bean:define id="newbean" name="SampleForm" scope="request" />
    username::<bean:write name="newbean" property="thename" scope="page" /> <br>
     
        <table align=center cellspacing="1" cellPadding="2">  
    <tr>
       <td>name</td>
    <td >:<%=request.getAttribute("thename")%></td>
    </tr>
    <tr>
       <td>password</td>
    <td >:<%=request.getAttribute("thepassword")%></td>
    </tr>

        </table>
    </center>我在session中赋值是为了证明我的值已经传到了action中,在jsp页面中可以取出,但是想继续利用这个forbean却不行了下面是struts-config.xml中的设置
    <action path="/sample" 
    type="sample.SampleAction" 
    scope="request" 
    name="SampleForm"> 
    <forward name="play" path="/success.jsp" redirect="true" /> 
    </action> 
    还请大侠们多帮忙阿