You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nicolas De Loof <ni...@cgey.com> on 2003/04/04 13:32:11 UTC

Re: causes Cannot find bean ...

Add "logic" taglib
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

and drop "nested" one if you don't use it in your JSP

Nico.




> According to the literature I've seen, the following JSP should be fine:
> 
> -------------------test.jsp
> <%@ page import="java.util.ArrayList,
>                  java.util.List"%>
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> 
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
> <%
>     List list = new ArrayList();
>     list.add("bla");
>     list.add("bla bla");
>     pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);
> %>
> 
> <logic:iterate id="currentBean" name="list">
>   <bean:write name="currentBean"/>
> </logic:iterate>
> ---------------------eof test.jsp
> 
> However, this results in a JSP-exception: "Cannot find bean currentBean in
> any scope".
> 
> I use struts-1.1-rc1. Does anyone have ideas? The corresponding nested-tag
> works fine.
> 
> Thanks in advance, -Jan
> 
> -----------------
>       Jan Voskuil
>     Anachron B.V.
>         Amsterdam
>  jan@anachron.com
> -----------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org