aspose file tools*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
Author

Help with jstl forEach spring 2.0 binding

John Lintini
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 61064
    
  66

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Help with jstl forEach spring 2.0 binding