...this is vboxLayout.jsp,
<%@ page import="java.util.Iterator"%> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%-- Layout component Render a list of tiles in a vertical column @param : list List of names to insert
--%>
<tiles:useAttribute id="list" name="list" classname="java.util.List" />
<%-- Iterate over names. We don't use <iterate> tag because it doesn't allow insert (in JSP1.1) --%> <% Iterator i=list.iterator(); while( i.hasNext() ) { String name= (String)i.next(); %> <tiles:insert name="<%=name%>" flush="true" /> <br>
<% } // end loop %>
...this is columnsLayout.jsp,
<%@ page import="org.apache.struts.tiles.ComponentContext"%> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%-- Layout component Render a list on severals columns parameters : numCols, list0, list1, list2, list3, ... --%>
<tiles:useAttribute id="numColsStr" name="numCols" classname="java.lang.String" />
<table> <tr> <% int numCols = Integer.parseInt(numColsStr); ComponentContext context = ComponentContext.getContext( request ); for( int i=0; i<numCols; i++ ) { java.util.List list=(java.util.List)context.getAttribute( "list" + i ); pageContext.setAttribute("list", list ); if(list==null) System.out.println( "list is null for " + i ); %> <td valign="top"> <tiles:insert page="/common/layouts/vboxLayout.jsp" flush="true" > <tiles:put name="componentsList" beanName="list" beanScope="page" /> </tiles:insert> </td> <% } // end loop %> </tr> </table>
This is the error...
DEBUG - insert page='/common/layouts/columnsLayout.jsp'.
DEBUG - servletPath=/common/layouts/columnsLayout.jsp, pathInfo=null, queryString=null, name=null
DEBUG - Path Based Include
DEBUG - insert page='/common/layouts/vboxLayout.jsp'.
DEBUG - servletPath=/common/layouts/vboxLayout.jsp, pathInfo=null, queryString=null, name=null
DEBUG - Path Based Include
ERROR - Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Error - tag useAttribute : attribute 'list' not found in context. Check tag syntax
at org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.java:184)
at org.apache.jsp.common.layouts.vboxLayout_jsp._jspService(org.apache.jsp.common.layouts.vboxLayout_jsp:73)
Jim
From: Pavel Kolesnikov <[EMAIL PROTECTED]> Reply-To: Pavel Kolesnikov <[EMAIL PROTECTED]> To: Struts Users Mailing List <user@struts.apache.org> Subject: Re: Check Tag problem? Date: Mon, 3 Jan 2005 18:52:21 +0100
It simply says it can't find tile definition referenced by "name" attribute of
your "useAttribute" tag. Try to check out if your tiles definitions.
Pavel
On Mon, 03 Jan 2005 03:08:57 +0000, Jim Douglas <[EMAIL PROTECTED]> wrote:
> I used the example that came with tiles to create a site and I keep getting
> this error below,
>
> ERROR - Servlet.service() for servlet jsp threw exception
> javax.servlet.jsp.JspException: Error - tag useAttribute : attribute 'list'
> not found in context. Check tag syntax
> at
> org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.java:184)
> at
> org.apache.jsp.common.layouts.vboxLayout_jsp._jspService(org.apache.jsp.common.layouts.vboxLayout_jsp:73)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
>
> Where do I look to check the Tag Syntax?. (I never changed it!)
>
> The only thing I have done is to move all the layout files into a common
> directory. (columnslayout.jsp, body.jsp, header.jsp and footer.jsp. I made
> sure the files are in the right location but I keep getting this error)
>
> Jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]