应该是
function itiransentou(currentPage){
      document.kensyumeiList.action="kensyumeiList.do?currentPage=" + currentPage;
      document.kensyumeiList.submit();
}

function itiransentou(currentPage){
      document.forms(0).action="kensyumeiList.do?currentPage=" + currentPage;
      document.forms(0).submit();
}

解决方案 »

  1.   

    谢谢楼上这位好心人,我照你说的改了,但是在控制台上还是输出"当前页:null"..呜呜...
      

  2.   

    我一般这样的做法,
    在form中定义一个currentPage,(用隐含变量<input type="hidden" name="currentPage"/>)
    然后
    function itiransentou(currentPage){
          //alert(currentPage);
          document.forms(0).currentPage = currentPage;
          document.forms(0).submit();
    }
    ,
    你可以一步步调试嘛,多加几个alert()仔细测试看
      

  3.   

    还有
    <FORM action="" name="kensyumeiList">
    action内容需要填写,
    应该改成
    <FORM action="kensyumeiList.do" name="kensyumeiList">
      

  4.   

    谢谢楼上这位热心人。
    我现在做的是分页查询,当我点击但是当我在页面上点击<input type="button" value="一覧の先頭へ" onclick="itiransentou(1)" />按钮时,应该把参数“1”传递到action,当我点击"一覧の先頭へ"按钮时,参数“1”无论怎样都传不过去,不知道你有什么好办法吗?
      

  5.   

    就是这样子的呀,你如果用get方式,提交后,点击右键->属性,就可以看到有xxx.do?&xx=xx&currentPage=1了
    <FORM action="kensyumeiList.do" name="kensyumeiList" method="get">
    <input type="hidden" name="currentPage"/><input type="button" value="一覧の先頭へ" onclick="itiransentou(1)" />
    <a href="kensyumeiList.do?currentPage=1">一覧の先頭へ</a>
    </form>在action中,String currentPage = request.getParameter("currentPage");就能取到结果了。
      

  6.   

    现在能够正确转到action的execute(...)方法,但是传过去的参数总是为“null”,例如点击<input type="button" value="一覧の先頭へ" onclick="itiransentou(1)" />按钮时,在控制台上输出"当前页:null",清哪位高人帮忙分析一下,小弟真是要憋疯了。
      

  7.   

    超连接是无法作为表单项传过去的,如果你要传这个数据需要声明一个hidden,然后name=currentPage,value=1,这个value属性你可以在itiransentou方法中赋值给这个hidden,然后提交表单就ok了,另外表单里面要有对应的currentPage字段来接这个值,还有在数据判断那个部分不要判断错 ,否则还是无法传过去的
      

  8.   

    哦,搞错一个地方了,应该是
    function itiransentou(currentPage){
          //alert(currentPage);
          document.forms(0).currentPage.value = currentPage;
          document.forms(0).submit();
    }