aspose file tools*
The moose likes JSP and the fly likes Drop Down Box values cannot be retained on JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Drop Down Box values cannot be retained on JSP page" Watch "Drop Down Box values cannot be retained on JSP page" New topic
Author

Drop Down Box values cannot be retained on JSP page

Dinesh Remje
Ranch Hand

Joined: Jan 26, 2010
Posts: 57
Following is the code i have written in a jsp page


Now in the variable 'designation' i am able to get the value selected by user, but i am not able to display the selected value on jsp page.
So in this case what should be done.

Thanks in advance
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 516



Here you have to compare the "designation" that you received from Request attribute and and the one you are retrieving from designations array. If they match set the "selected" property of that option.
The HTML looks like below for the option that is selected.


Regards,
Amit
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61774
    
  67

Scriptlets and Java code in a JSP have been discredited for almost 10 years. It's time to update your JSP knowledge with the JSTL and EL.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dinesh Remje
Ranch Hand

Joined: Jan 26, 2010
Posts: 57
@amit thanks amit i was successfully able to do it.
@Bear Bibeault i will keep it in my mind and will try to learn it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Drop Down Box values cannot be retained on JSP page