This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Select in Spring

 
Pavan Tummala
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the best way to deal with html:select in Spring framework, Is spring:bind helpful?
 
Ken Krebs
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pavan,

Typically in Spring MVC, you will manually extract the select parameter value by overriding the onBindAndValidate method in your controller. For example:



This ensures that the parameter is set during the binding and validation process and the workflow will result in a call to onSubmit if all is OK or showForm (with appropriate error messages) if not. The jsp code containing the select should be wrapped inside a spring:bind tag.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic