File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Help with jstl forEach spring 2.0 binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Help with jstl forEach spring 2.0 binding " Watch "Help with jstl forEach spring 2.0 binding " New topic

Help with jstl forEach spring 2.0 binding

John Lintini

Joined: Dec 15, 2009
Posts: 2
Good Morning Ranch I am hoping somebody can help me out. I will greatly appreciate it.

I am implementing search functionality to a web form in which a user enters in a value for an Id (say 41). That value is then binded to a searchValue field in my command object, and then I have an Ibatis query that populates a list based on Id 41. The elements in that list are then displayed on a separate page for example

Id: 41 Year:2002 [SUBMIT]
Id: 41 Year:2003 [SUBMIT]
Id: 41 Year:2004 [SUBMIT]
Id: 41 Year:2005 [SUBMIT]
Id: 41 Year:2006 [SUBMIT]
Id: 41 Year:2007 [SUBMIT]

I also have Id and Year properties in my command Object, so my question is how can I bind the Id and Year so that when a user clicks submit for a row it will take them to another page with details populated for that row (ex details for ID=41 year=2003)??

I understand dynamic list binding and how to bind a variable for each iteration of the loop but how can I take the value say command.list[${loop.index}].id and command.list[${loop.index}].year and assign it to the command object Id and Year in order to populate the next page??

Once a user selects a row Im not sure how to dynamically get the binded fields to be assigned to the command id and year fields to run a new query. Please Help!! Thank you
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63547

"newKidOn TheBlock", please check your private messages for an important administrative matter.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Help with jstl forEach spring 2.0 binding
jQuery in Action, 3rd edition