I have a navigation bar and, for some pages, a sub-navigation bar as well.  I'd like to make this a module so I can easily import the navigation bars on each page.  Easy enough to simply put the code in a JSP file and call:

&lt;%@include file="/WEB-INF/jsp/includes/sub_nav_bar.jsp"%&gt;


the only issue is the links and their labels change depending on what page you're on.  So my options are to create separate navigation bars for various groups of pages or pass in variables representing the links and labels.  Separate navigation bars isn't attractive because there are so many variations, particularly with the sub nav bars.  I'll end up with tons of navigation bars, all of which I have to maintain.

The variables approach works, but I'm hoping there's a better way to do this.  It's so messy and lengthy.  If I want to later have drop down menus, it's going to be even much worse.  Basically, I've done something to this effect:

&lt;c:set var="subNav" value="1"/&gt;
&lt;c:set var="subNavLink1" value="/"/&gt;
&lt;c:set var="subNavLabel1" value="Home"/&gt;
&lt;c:set var="subNavLink2" value="/fun"/&gt;
&lt;c:set var="subNavLabel2" value="Fun Stuff"/&gt;
&lt;c:set var="subNavLink3" value="/more"/&gt;
&lt;c:set var="subNavLabel3" value="More Stuff"/&gt;
&lt;%@include file="/WEB-INF/jsp/includes/sub_nav_bar.jsp"%&gt;


the sub_nav_bar.jsp include file looks pretty ugly:

&lt;ul id="sub-nav"&gt;
    &lt;li class="&lt;c:if test="${subNav!='1'}"&gt;in&lt;/c:if&gt;active"&gt;&lt;a href="&lt;c:url value='${subNavLink1}'/&gt;"&gt;${subNavLabel1}&lt;/a&gt;&lt;/li&gt;
    &lt;c:if test="${subNavLink2!=null}"&gt;&lt;li class="&lt;c:if test="${subNav!='2'}"&gt;in&lt;/c:if&gt;active"&gt;&lt;a href="&lt;c:url value='${subNavLink2}'/&gt;"&gt;${subNavLabel2}&lt;/a&gt;&lt;/li&gt;&lt;/c:if&gt;
    &lt;c:if test="${subNavLink3!=null}"&gt;&lt;li class="&lt;c:if test="${subNav!='3'}"&gt;in&lt;/c:if&gt;active"&gt;&lt;a href="&lt;c:url value='${subNavLink3}'/&gt;"&gt;${subNavLabel3}&lt;/a&gt;&lt;/li&gt;&lt;/c:if&gt;
    &lt;c:if test="${subNavLink4!=null}"&gt;&lt;li class="&lt;c:if test="${subNav!='4'}"&gt;in&lt;/c:if&gt;active"&gt;&lt;a href="&lt;c:url value='${subNavLink4}'/&gt;"&gt;${subNavLabel4}&lt;/a&gt;&lt;/li&gt;&lt;/c:if&gt;
&lt;/ul&gt;


So is there a better way?


Question: Effects of nuclear explosions in space?
Answer: Purely for informational purpose,  there has/had been some consideration of using nuclear detonations as primary propulsion for a space-faring craft.

Wikipedia: Project Orion (nuclear propulsion)

Short term effects:   propulsion (most likely)!

Long term effects:   ?????