userDao ud=new userDao();
List<userEntity> ue=ud.getAllUserInfo();
HttpSession session=req.getSession();
session.setAttribute("user", ue);
req.getRequestDispatcher("user.jsp").forward(req, resp);我要在JSP页面中怎么样才能获得我传过来的session对象????
另外一个问题如题。。在线等答案,~~~~(>_<)~~~~ 

解决方案 »

  1.   

    那取到值了怎么用呢?   如何遍历整个集合呢?items="${sessionScope.user}"
    能写得再具体点嘛??
      

  2.   

    应该是item="{sessionScope.user[i]}"吧
      

  3.   

    ${sessionScope.user}
    一般要用foreach遍历出来user的所有属性,这个你肯定会吧。祝工作顺利。
      

  4.   

    看你页面怎么显示的用JSTL可以这么遍历集合<c:forEach var="bm" items="${list}">
      <tr><td align="center"><input type="checkbox" id="sel" name="sel" value="${bm.id}"></td>
      <td align="center"><img src="<%=basePath %>images/bg_users.gif"></td>
      <td align="center"><img src="<%=basePath %>images/t_5.gif"><img src="<%=basePath %>images/t_5.gif">
      <img src="<%=basePath %>images/t_5.gif"></td>
      <td align="center"><c:out value="${bm.nickname}"></c:out></td>
      <td align="center"><c:out value="${bm.others}"></c:out></td>
      <td align="center"><a href="ListAllUserServlet?who=${bm.others}"><img src="<%=basePath%>images/xie.jpg"></a></td>
      <td align="center"><a href="main.files/updUser.jsp?zt=${bm.others}"><img src="<%=basePath %>images/xg.gif" style="cursor:hand"></a></td>
      <td align="center"><a href="delUserServlet?zw=${bm.others}"><img src="<%=basePath %>images/sc.gif" style="cursor:hand"></a></td>
      </tr>
      </c:forEach>