[thelist] JSP help please

Tom Dell'Aringa pixelmech at yahoo.com
Tue Jan 13 12:54:09 CST 2004


Hey folks,

I have a template with 2 levels of navigation. Sometimes the 2nd
level show up, sometimes not. In addition, there are 5 versions of
the level 2 nav, depending on what section you are in.

So my layout is like so:

<body>
<jsp:include page="includes/nav.jsp"/>
content here
</body>

What I want to do is make the HTML in the nav.jsp include
conditional, depending on what page the user is on. For example, if
the section is "plan" then the HTML for the subnav for that section
should show up, etc.

My nav include looks something like this:

<ul id="nav">
  <li id="nav-index"><a href="/index.jsp">Home</a></li>
  [etc, etc]
</ul>

--- the below navs should be conditional based on section ---

<ul id="subnav-plan">
  <li id="nav-index"><a href="/index.jsp">plan</a></li>
  [etc, etc]
</ul>

<ul id="subnav-reports">
  <li id="nav-index"><a href="/index.jsp">reports</a></li>
  [etc, etc]
</ul>

So in the above case, I only want to write out either subnav-plan or
subnav-reports, based on what section I'm in.

What would be the best way to do this? I've failed with a couple
attempts using the session, not sure how to approach this really, I 
don't do much JSP, so any help is appreciated. 

Thanks!

Tom



=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: JavaScript Author / Every Friday!
http://www.thywordistruth.net/ :: Eternal Life

[Those who say that I am finished, and am through, will have to run over my dead body to beat me...]


More information about the thelist mailing list