This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes logic iterate something wrong Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "logic iterate something wrong" Watch "logic iterate something wrong" New topic
Author

logic iterate something wrong

Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 254
in my action:
I have an arrayList(called names) of objects. and i set this arraylist in my form.

in my jsp i do this:
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
Can you attach the exact error message that gets printed in the console so that it would get a better idea of what is going wrong here ??
[ August 25, 2005: Message edited by: Mohen Vijay ]
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 254
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
DO you have an attribute name in your object ??

Try giving the TYPE attribute in logic:iterate, that may help to cast it to the right object..
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 254
yes.
and did'nt work
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4725

I think that when you are submitting the page, the arrayList is no longer full of name objects (I'm assuming you are using request scope). So Struts says, "Give me name #x from the arrayList so I can call setName() on it. What? There's no object? Exception!"

Here's a few methods for getting around this problem.


A good workman is known by his tools.
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 254
that was it!!!
a little more info in the error would have been great.. but hey alls well that ends working...

thanks Marc
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: logic iterate something wrong
 
Similar Threads
nested logic:iterate
Nested tag problem
Logic iterate
Regarding Logic iterate
how to apply continue statement in struts logic:iterate tag