Win a copy of The Java Performance Companion this week in the Performance 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