struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sri Sankaran" <Sri.Sanka...@sas.com>
Subject RE: logic:iterate question
Date Tue, 03 Dec 2002 20:31:53 GMT
Dumb question:  Is the object reference 'myObj' pointing at anything before set it to the name
'myObj'?  That sounds confusing -- too many myObjs floating around.  Suppose you had

pageContext.setAttribute("myObj", foo, PageContext.PAGE_SCOPE);

My question is whether 'foo' is set before this call.

Sri

> -----Original Message-----
> From: Andy Kriger [mailto:akriger@greaterthanone.com] 
> Sent: Tuesday, December 03, 2002 3:24 PM
> To: Struts Users Mailing List
> Subject: logic:iterate question
> 
> 
> I have a JSP. I have some scriplet code that defines an 
> object and then I want to iterate over that object, but I 
> keep getting an error that the object is not defined in the 
> page scope. Looking at the docs I don't understand what I'm 
> doing wrong.
> 
> ---
> 
> <%
>    pageContext.setAttribute("myObj", myObj, 
> PageContext.PAGE_SCOPE); %>
> 
> <logic:iterate id="ele" name="myObj" property="records" scope="page">
>    <!-- do stuff -->
> </logic:iterate>
> 
> ---
> 
> myObj has a getRecords() method that returns the array i want 
> to iterate over
> 
> When i load the page i get 'Cannot find bean myObj in scope 
> page' Any ideas?
> 
> thx
> andy
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 
> 

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


Mime
View raw message