• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Help needed with Spring binding and <form:select>  RSS feed

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!