Add Navigation Bar to Java Spring [Maven]

Add Navigation Bar to Java Spring [Maven]

Add navigation bar to your Spring Java project [Maven], start by adding something similar to the below example snipit

Just place below code inside the  tag.

<pre><code><nav role="navigation" class="navbar navbar-default">
<div class="">
<a href="http://www.dotsway.com" class="navbar-brand">dotsway blog -- your daily information gate</a>
</div>
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="/login">HomePage</a></li>
<li><a href="/link-page">Link</a></li>

</ul>
</div>
</nav></code></pre>

That's it ! now you have a navigation menu, but then you need to place the above code in all pages, instead you can use JSP fragments which will help you not to repeat the code but have a header JSP , footer...etc, to read about JSP Fragments click here.