You don't need the jsp:useBean action for JSTL to get at mbox. You can just do:

<c:forEach var="header"
           items="${sessionScope.mbox.list}"
           varStatus="status">

"header" is an implicit object in JSTL, so I'd call your iteration var 
something else, like "hdr".

Quoting Vernon Wu <[EMAIL PROTECTED]>:

> 
> To illustrate the problem, I provide the following two parts of code/file
> sample.
> 
> In a JSP file, I have the followings:
> 
> <jsp:useBean
>   id="agentHelper"
>   class="com.xxx.web.client.AgentHelper"
>   scope="session"
> />
> 
> <c:set value="${agentHelper.newMembers}" var="pageResults" />
> 
>       <c:forEach var="item" items="${pageResults.list}" >
>               <tr>
>               <td class="TableRowColor"><c:out 
value="${item.headline}" /></td>
>               <td class="TableRowColor">              
>                       <c:url value="search-by-id-action.do" var="viewItemURL">
>                               <c:param name="id" value="${item.userId}"/>
>                               </c:url>
>                               <a href='<c:out value="${viewItemURL}"/>' 
onmouseover="img_on
> ('signout')" onmouseout="img_off('signout')">
>                               <c:out value="${item.userId}" />
>                       </a>
>                       </td>
>               <td class="TableRowColor"><c:out value="${item.age}"/></td>
>               </tr>
>       </c:forEach>
> 
> This page works fine. I use the other implementation method using MVC pattern
> instead for another page. In the 
> controller, I have the followings:
> 
>               session.setAttribute("mbox", a.openMessageBox(0, 10));
>       
> The data is correct at this point. And in the following JSP file I have the
> followings:
> 
> <jsp:useBean
>   id="mbox"
>   class="com.xxx.web.client.model.Page"
>   scope="session"
> />
> 
>   <c:forEach var="header" items="${mbox.list}" varStatus="status">
>   <tr>
>       <td>
>       <input type="checkbox" name="checkbox" value="checkbox">
>     </td>
>     <td>&nbsp;</td>
>     <td><c:out value="${header.from}"/></td>
>     <td><c:out value="${header.subject}"/></td>
>     <td>&nbsp;</td>
>     
>   </tr>
>   </c:forEach>
> 
> The iteration is walked through, but no data is displayed. I don't understand
> why the second implemention doesn't 
> display the data. Can anyone see a problem here/
> 
> Thanks,
> 
> Vernon
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:taglibs-user-help@;jakarta.apache.org>
> 
> 


-- 
Kris Schneider <mailto:kris@;dotech.com>
D.O.Tech       <http://www.dotech.com/>

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org>

Reply via email to