jsp里面在<html:form action="/checkitemListAction" method="POST" scope="request" >下有<html:hidden property="big" />,查看源文件有值:<input type="hidden" name="big" value="1">
form里面定义了  private int big;
action里面CheckitemListForm checkitemListForm = (CheckitemListForm) actionForm;后查看
checkitemListForm.getBig(),值却是0,为什么值传不过来呢?
请帮帮我阿

解决方案 »

  1.   

    再补充两句:action里面只有一个方法excecute
    jsp里面提交的一个连接是<html:link action="/checkitemListAction" paramId="currentPage" paramName="firstPage">&nbsp;第一页&nbsp;</html:link>
      

  2.   

    ActionForm里面有没有void setBig(int i)这个函数?
      

  3.   

    你用的是html:link ,它只是一个链接,没有提交表单啊,<input type="hidden" name="big" value="1">这个值需要提交表单才能被传入action的,如果你一定要用link,那可以用javascript实现提交表单。
      

  4.   

    看看formbean的格式有没有写对?还有配置文件都对应起来了没有?
      

  5.   

    还有提交表单一定要用到submit(),link的话就要javascript
      

  6.   

    再麻烦大家一下:
    我添了js:document.forms[0].big = document.getElementById('big').options[document.getElementById('big').selectedIndex].value;
    其他部分修改:
    <html:hidden property="big" styleId="big" />
    <html:link action="/checkitemListAction" paramId="currentPage" paramName="firstPage" onclick="return trans()">&nbsp;第一页&nbsp;</html:link>
    还是不行
      

  7.   

    还有,不用<html:link>就可以传递了??
      

  8.   

    你用链接的话是get方式获取值 而你的:<input type="hidden" name="big" value="1">
    是post方式 所以你要想获得big的值需要在链接后面加上&big=1 或者用post方式提交
      

  9.   

    我一开始就是post啊:<html:form action="/checkitemListAction" method="POST" scope="request" >
      

  10.   

    再请教一下:
    我改成<a href>,传递&big=<%=big%>试过,是当然可以的。
    可是<html:link>没有method方法,还有它是不是只能传一个参数啊,那参数big传递呢?
    现在是写成这样:
    function trans(){
      checkitemListForm.submit();
    }
    <html:hidden property="big" styleId="big" />
    <html:link action="/checkitemListAction" paramId="currentPage" paramName="firstPage" onclick="trans()">&nbsp;第一页&nbsp;</html:link>form:
     1.public void setBig(int big) {
     2.   this.big = big;
     3. }
    action:
    4. CheckitemListForm checkitemListForm = (CheckitemListForm) actionForm;
    5. ....
    可是单步看,先到:2,再到4,接着3,然后也不知到哪,最后到5,big值早成0了
    可有时又不经过setBig,直接到4,再到5,big值当然还是0
    还是不对,到底应该怎么写呢?