I have couple of drop downs in my jsp . User selects one of the option and submit the form ,which will get inserted into the database.
But when i retrieve the record for update on the JSP my drop down donot retain the previously selected option. How to code this. I am using simple JSP page.
suppose you have selected update option you check for VO.
In update case if data is in database then VO will not be null so you check for VO not null condtion.
If VO is not null then retrive the value and put select i mean
<option value="<%=exampleVOArray[i].getname()%>" selected>
Try this