struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marion Schwarz" <Marion.Schw...@prosieben.de>
Subject iterate in a template
Date Wed, 22 Aug 2001 07:49:05 GMT
Hello world,

I'm trying to fill a struts template with an interate tag. The collection, an ArrayList, is
set in the jsp page.
My Code looks like this:

JSP-Page
=========================================================
...
<%
              ArrayList testList = new ArrayList();
              testList.add("test_1");
              testList.add("test_2");
              testList.add("test_3");

              pageContext.setAttribute("testList", testList, PageContext.PAGE_SCOPE);
%>
              <template:insert template='template.jsp'>
              <template:put ... 
                                                  including various template contents
              </template:insert>

...





Template- Page
===============================================================================
<%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %>
<%@ taglib uri='/WEB-INF/struts-logic.tld' prefix='logic' %>
<%@ taglib uri='/WEB-INF/struts-bean.tld' prefix='bean' %>
<% Object testList = pageContext.getAttribute("testList", PageContext.PAGE_SCOPE );  %>

<table>
...
          <template:get ...
                         various template contents

...
          <td width=125>
            <logic:iterate id="myList" name="testList" >
                <p><bean:write name="myList" /><p>
            </logic:iterate>
         </td>
</table>
============================================================================


Unfortunatly I keep getting a  PageContextImpl.handlePageException.
What am I doing wrong ??


Marion




Mime
View raw message