This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes How work with iterator? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How work with iterator?" Watch "How work with iterator?" New topic

How work with iterator?

Honzak Troubak
Ranch Hand

Joined: Jan 11, 2013
Posts: 31
Hello everybody,

I need help with Struts2 iterator.

Here is my code

Forcycle gives picture and list gives describe of that picture. I need to have on one line Picture1 and describe1. At other line Picture2 describe2, etc. But i don't know how to do it.

I thing I need use IF (if line of sponsorList == numberOfRun) and in iterator I need to write something like "get propesties of that line (in my mind something like <s:property value="nameSponsor.get(numberOfRun)"/>)

I hope explain of my problem is sufficient.

Do anybody know how to do it?

thank you very much
Honzak Troubak
Ranch Hand

Joined: Jan 11, 2013
Posts: 31
Problem resolved, here is solution:

Joe Ess

Joined: Oct 29, 2001
Posts: 8836

My advice would be to avoid scriptlets (java code) in JSP's. JSP's should only deal with display logic. Other programming tasks should be taken care of in an action or business logic class.
JSP Best Practices

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Consider Paul's rocket mass heater.
subject: How work with iterator?
Similar Threads
iterator and <s:radio /> question
Querying DB and Iterating over the resultset
How to access a property attribute of a value outside of an iterate, but within another iterate
Iterator doesn't show picture
Struts property tag question