This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
Don't get me started about those stupid light bulbs.
 
subject: Help needed with Spring binding and <form:select>
 
Similar Threads
New value is inserted into db in @ManyToOne relation instead of update
java.lang.IllegalStateException:- when generating excel report
Help needed to indicate "selected" for <form:select> <form:option/>
Validation errors not displayed
Bean cant be created error