日期:2014-05-17  浏览次数:20652 次

用for each通过查询串传递值时候出现了个问题求帮助
<c:forEach items="${operators}" var="operator">
  <tr>
  <td width="25%" align="center" height="17">${operator.operatorid}</td>
  <td width="25%" align="center" height="17">${operator.operatorname}</td>
  <td width="25%" align="center" height="17">${operator.isadmin}</td>
  <td width="25%" align="center" height="17"><a href="modOperator.jsp?operators=operator">&gt;&gt;</a></td>
  </tr>
  </c:forEach>



这里的operator是个vo,里面有id ,name 之类的信息
我通过点击不同的超链接到modOperator.jsp之后每次得到的内容都是第一次循环的数据 不是应该点击不同的超链接我得到不同的值么

------解决方案--------------------
<a href="modOperator.jsp?operators=${operator}">&gt;&gt;</a>
可以在超链接里面写EL表达式
  

------解决方案--------------------
那你就写成这样嘛把ID和name都当参数传递过去
<a href="modOperator.jsp?operatorid=${operatorid}&operatorname=${operator.operatorname}">&gt;&gt;</a>
 

------解决方案--------------------
探讨

地址栏是正确的 我用
<%=request.getParameter("operatorid") %>
<%=request.getParameter("operatorname") %>
接收打印出来都是null奇怪啊

------解决方案--------------------
你可以在检查一下,你的相关页面,是否经过多次转码!如果有,会影响到到你的数据接收的。