rakesh menon
rakesh menon

Reputation: 1101

Highlight the selected menu in spring with struts

Is there any way to highlight the current menu which have been clciked.I am using left-mnu.jsp in which i have all the menu which i am including in each jsp pages.Now i use a variable clicked and update this variable to some value when i open main jsp pages.Then am checking this variable in left-menu.jsp to highlight the appropriate menu.I know this is not a good approach.Can any one suggest me a good one for highlighting menu.

Upvotes: 1

Views: 669

Answers (1)

Andrea Ligios
Andrea Ligios

Reputation: 50203

You can do that with CSS only, setting the id of the home with a word related to the id of the selected menu item, like described here.

Or with Javascript, matching the URL of the current page with the URL of the menu items (if they're href), like described here (approach #2)

Or do it with JSP tags, etc...

Upvotes: 4

Related Questions