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,为什么值传不过来呢?
请帮帮我阿
form里面定义了 private int big;
action里面CheckitemListForm checkitemListForm = (CheckitemListForm) actionForm;后查看
checkitemListForm.getBig(),值却是0,为什么值传不过来呢?
请帮帮我阿
解决方案 »
- 关于 frameset 的滚动条问题
- 网页中实时显示数据库数据的问题?(应用了xmlhttp)
- 各位高手们,谁能帮我看看这个JSP作业啊,呜呜呜呜
- 高手进来帮我看看这段话!
- 一个关于EXCEL报表导出的问题(无法读取)
- 高分求struts2大文件上传,并且支持断点续传的解决方案
- ++++++<%include file=""%>**¥¥与¥¥<jsp:include path=""/>有什么区别??
- 有使用intelliJ IDEA的吗?
- 偶快疯了,高手们帮忙看看
- 怎么存储附件(如,Excel、Word等)?
- 20 分问:javascript 的简单问题,如何防止用户用 ctr+v 复制内容到 html 中的text
- 请问怎么用相当路径连接access数据库呀?急急急呀!
jsp里面提交的一个连接是<html:link action="/checkitemListAction" paramId="currentPage" paramName="firstPage"> 第一页 </html:link>
我添了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()"> 第一页 </html:link>
还是不行
是post方式 所以你要想获得big的值需要在链接后面加上&big=1 或者用post方式提交
我改成<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()"> 第一页 </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
还是不对,到底应该怎么写呢?