页面内获取不到值的问题

hyperprice 2009-08-26 02:15:05
简述下问题:我有个jsp页面,有个表单需要上传文件和传递参数。页面最下方有分页。

现在的问题是 不点分页的情况下 跳转包括获取参数一切正常 说明后台action没问题 但一分页后就获取不到参数了

表单我给大家帖出来 麻烦大家了 急!

<form name="answerForm" method="post" action="exslistform.html" enctype="multipart/form-data">
<font color="gray">点击回答内容可以重新编辑</font>
<div id="tabarea">
<table class="tabstyle2" width="100%" border="0" cellspacing="0" cellpadding="2">
<input type="hidden" name="id" value="${courseWareAnswer.id }"/>
<input type="hidden" value="no" id="useFCK"/>
<input type="hidden" name="questionType" value="${questionType }"/>
<c:forEach items="${continueAnswers}" var="continueAnswer">
<tr class="tablehead">
<td colspan="2">
<div class="qtitle">
<STRONG>提问主题</STRONG>:${continueAnswer.title }
</div>
</td>
</tr>
<tr>
<td width="20%" valign="top" >
<div class="qtime">学员:${continueAnswer.user.username }
<hr size="1" color="#cccccc" width="80%" />
提问时间:<fmt:formatDate value="${continueAnswer.createTime}" type="both"/>
</div></td>
<td>
<div id="studentword" class="answercontent">
<div>【提问内容】</div>
${continueAnswer.content }
</div>
</td>
</tr>
<c:set var="isQasAdmin" value="${false}" />
<c:forEach items="${currentUser.roles}" var="role">
<c:if test="${role.authority == 'ROLE_QASADMIN' || role.authority == 'ROLE_QUESTIONADMIN'}">
<c:set var="isQasAdmin" value="${true}" />
</c:if>
</c:forEach>
<tr>
<td width="20%" valign="top" >
<div class="qtime">老师:${continueAnswer.teacher.username }
<hr size="1" color="#cccccc" width="80%" />
回答时间:<fmt:formatDate value="${continueAnswer.answerTime}" type="both"/>
<td width=600>
<div id="teacherword" style="width:680px">
<div <c:if test="${empty continueAnswer.answer || continueAnswer.teacher.username==currentUser.username || isQasAdmin}">onclick="window.location='${ctx }/teacher/toexsanswer.html?mid=${courseWareAnswer.id }&id=${continueAnswer.id }&type=${courseWareAnswer.questionType}&questionType=${questionType }'" style="cursor:hand;" title="点击内容可以重新编辑" </c:if>>【答疑老师解答】
<c:if test="${not empty continueAnswer.answer}">
<c:out value="${continueAnswer.answer}" escapeXml="false"/>
</c:if>
<c:if test="${empty continueAnswer.answer}">
<font color="red">快速回答</font>
</c:if>

<c:if test="${not empty continueAnswer.satisfaction}">
   
<fieldset><legend><font color="red">学员评价</font></legend>
<c:set value="${continueAnswer.satisfaction }" var="satisfy" scope="request"/>
   <%=SatisfyConstant.getLabelByValue((Integer)request.getAttribute("satisfy")) %>
<c:if test="${not empty continueAnswer.info}">
:<br/>   ${continueAnswer.info }
<br/>
</c:if>
</fieldset>
</c:if>
</div>
</td>
</tr>
</c:forEach>

</table>
<p align="right">${footer }</p>
</div>
</form>


<c:if test="${empty continueAnswer.answer || continueAnswer.teacher.username==currentUser.username || isQasAdmin}">onclick="window.location='${ctx }/teacher/toexsanswer.html?mid=${courseWareAnswer.id }&id=${continueAnswer.id }&type=${courseWareAnswer.questionType}&questionType=${questionType }'" style="cursor:hand;" title="点击内容可以重新编辑" </c:if>

就是这段的type和questionType获取不到 另外两个可以 不分页全都可以正常获取 一分页只有后两个获取不到!
...全文
167 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
yifeng7956 2009-08-26
  • 打赏
  • 举报
回复
在跳转的时候把值传走就可以了。request.setAttribute("key",list);
ivws_19 2009-08-26
  • 打赏
  • 举报
回复
看下action里需要哪些参数,在jsp里用hidden域加上
lihao1129 2009-08-26
  • 打赏
  • 举报
回复
要用到request.setAttribute("pb", pb);
其中 这里pb里的 值要跟你页面上的对应起来
qqyatou 2009-08-26
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 quxiuer 的回复:]
分页的链接带上那些你需要的参数
[/Quote]

正解
quxiuer 2009-08-26
  • 打赏
  • 举报
回复
分页的链接带上那些你需要的参数
liu273513429 2009-08-26
  • 打赏
  • 举报
回复
购物车!
hyperprice 2009-08-26
  • 打赏
  • 举报
回复
怎么个操作法? 能否据个例子? 或给个demo? 谢谢。。
[小文] 2009-08-26
  • 打赏
  • 举报
回复
分页时参数没有保留。建议楼主分页时也将参数带上。
guodong66 2009-08-26
  • 打赏
  • 举报
回复
分页跳转的时候有些字段的值需要保存 , 所以跳转的时候如果走action就要把值传到Action。在传回来。
【如鱼饮水】 2009-08-26
  • 打赏
  • 举报
回复
通过地址栏输入的形式可以访问 不分页前也可以访问 只是分页后获取不到。。
---------------那就只能说明你在跳转的时候没有把值传过去~
你可以打印下值,看有没有得到~~或者设断点查看下
hyperprice 2009-08-26
  • 打赏
  • 举报
回复
写一页后 是什么意思? 通过地址栏输入的形式可以访问 不分页前也可以访问 只是分页后获取不到。。
action没有问题 公司不让动action 也确定action没有问题 是jsp的问题。。
【如鱼饮水】 2009-08-26
  • 打赏
  • 举报
回复
type和questionType 这个参数传到写一页后能获取不?
你可以存下来,在action读取

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧