This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes How to highlight the select item in JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to highlight the select item in JSP?" Watch "How to highlight the select item in JSP?" New topic
Author

How to highlight the select item in JSP?

Laxman Chowdary
Greenhorn

Joined: Apr 11, 2012
Posts: 21

Dear All,

When I click a Hyperlink, It will redirect to some JSP page. In that page the select items will be dynamically coming from database. When that JSP page is displaying to the end user I have to check in session the select property value is present or not.If there, then I have to highlight that value in select list. Generally the list will be with select by default. Eg: Select Process: Select. But the property value in session then i have to highlight means I have to display that value in the select list to the user
Eg.Select Process: Major (IF Major in session)


Thanks in Advance.
Laxman Chowdary.
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
You can put the select list and the item selected in request or session depending upon your use case, and use jstl to iterate over select item list. The following code should help.

 
jQuery in Action, 2nd edition
 
subject: How to highlight the select item in JSP?