This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Double action call when scriptlets in iterate tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Double action call when scriptlets in iterate tag" Watch "Double action call when scriptlets in iterate tag" New topic
Author

Double action call when scriptlets in iterate tag

Maciej Kolodziej
Greenhorn

Joined: Feb 11, 2002
Posts: 26
Hello,
Why, oh why this works:

while this doesn't:

And of course in the first case I cannot generate the strings I need with "name" property of "element".
Is it forbidden to place Java scriptlets inside the iterate tag? Because in the second case I get double call of main.do action and the second call doesn't have the attributes set.
[ January 27, 2003: Message edited by: Maciej Kolodziej ]

MK
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
in your second example, "element" is not a scripting variable--it is a variable in the pageContext. Try doing a pageContext.getAttribute() in order to access "element" in your scriptlet...


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: Double action call when scriptlets in iterate tag
 
Similar Threads
problem arises when refresh button is pressed
Iterate Hashmap through struts
images as hyperlinks
how to handle multiple iterates for the code
Please transform this Struts code to JSF tags