logic:iterate problem...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Riccardo_Fischetti
Posted On:   Monday, August 16, 2004 06:10 AM

Hi! i've a problem. i'm using a bean (previously setted as a session attribute) that contains a list Object (MMList). I've implemented getter and setter for this property. now, i want to get the objects on the list, using iterate: when i use this code, the tomcat will return the follow error: javax.servlet.ServletException: Cannot find bean mmobjin any scope Why this not work?!? I've read more examples and seems like this!!!! please, help me.    More>>

Hi!
i've a problem.
i'm using a bean (previously setted as a session attribute)
that contains a list Object (MMList). I've implemented getter and setter for this property.

			



now, i want to get the objects on the list, using iterate:


			






when i use this code, the tomcat will return the follow error:

javax.servlet.ServletException: Cannot find bean mmobjin any scope

Why this not work?!?
I've read more examples and seems like this!!!!
please, help me.

   <<Less

Re: logic:iterate problem...

Posted By:   John_Hughes  
Posted On:   Thursday, September 30, 2004 08:31 AM

I have opted to use JSTL in my work because it is a little more flexible and a little easier to use once you get you feet wet.



However, here is an example of how to do what you are trying to do using . I stole the example from a book (O'REILLY - Jakarta Struts Pocket Reference). I have added some comments (//comment) in some places:




The following is an example of iterating a bean property that holds a collection:

id="address" //name given to the current item
in the iteration
name="userSummary" //name of the bean in the session
property="addresses" //name of the property that
contains the list
scope="session"
type="com.oreilly.struts.customer.view.AddressView">






Hope this helps. The book I mentioned above is a pretty good reference for struts if you're interested.
About | Sitemap | Contact