GeeCON Prague 2014*
The moose likes Spring and the fly likes Help needed with Spring binding and <form:select> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Help needed with Spring binding and <form:select>" Watch "Help needed with Spring binding and <form:select>" New topic
Author

Help needed with Spring binding and <form:select>

laura mccord
Ranch Hand

Joined: Feb 10, 2009
Posts: 108
I'm trying to wrap my head on this but here is my scenario.

I have a class object called MovieTimeSlot which stores all movie show times. Which contains a movie object, an id, and timestamp of the showdate/time.



The Movie object looks like this:


I then have my controller, AdminTimeslotController, below is a snippet


My trouble is the jsp page setSchedule. I don't know how to use <form:select> to display the list of movies as an option. This is what I have so far:




I'm receiving an error: Nested Exception is java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'moveTimeslot' available as request attribute

I'm confused how to list the movies in the list. Or, perhaps I'm not thinking this out efficiently and perhaps my workflow needs to be revised.

Thanks.
T. Huy Nguyen
Ranch Hand

Joined: Nov 02, 2010
Posts: 57
Hi,

I think you need to instantiate a form object and put it into the model with name "movieTimeslot" to clear the error "Neither BindingResult nor plain target object ..."

Also, try using "items", "itemValue" and "itemLabel" attributes of SelectTag to display your movie list:



Sorry, I'm not my office to test if the code is syntactically correct.


My material for SCJP (2008), SCWCD (2010), SCBCD (2010). About me
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help needed with Spring binding and <form:select>