I have a jsp wherein I have a select box, which gets populated from the database on form load. How do I get the selected value in the drop down when i visit the same page again?what I exactly mean is that i want to retain the previously selected value in the select box the next time i revisit the same page. I'm able to populate the other text fields on the form with the values they originally had, when i revisit the page. How can I achieve this?
You need to make sure that the name attribute in select tag matches the getter for the selected value.
If that is not possible for some reason, you should be able to set the selected option by setting it explicitly in the value attribute.
The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny GillTweets