Building a web app using JSP for the first time, and attempting to make a navigation header to span all my pages, with the current page highlighted.
My understanding is that the way to share a header like this between my pages would be to use a JSP include tag at the top of each of my JSP files to include a file like header.jsp
, which contains my header markup.
However I'm not sure how I would approach applying conditional styling to the header, such that only the active tab is highlighted for each URL. I have an idea of how to accomplish this in JavaScript, but my instinct is that it'd be cleaner for this to be accomplished before responding.
Are any of my assumptions so far off base?
If not, what would be the JSP way to accomplish the goal of conditionally applying styling to an html element?
Thanks for any info!