JAVA JSP Fragments, What is it? how to do it ?!?

What is JSP Fragments?

You created a navigation menu in one JSP and you don't want to repeat the code all over again and again in every single JSP, here comes the benefit of the JSP Fragments.

If you need to know how to create or add the navigation bar code, check the create Java navigation menu bar page.

Create a folder under src/main/webapp/WEB-INF/jsp/common and then start creating different files like:

  • footer.jspf
  • header.jspf
  • navigation.jspf

Continue reading

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="" class="navbar-brand">dotsway blog -- your daily information gate</a>
<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>


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.

Add Date Picker to Java JSP

How to Add Java Date Picker


Date Picker
Below steps for adding the Date Picker on Java using the Bootstrap and Maven, first add below dependency to the pom.xml


Save or ctrl+s then Maven will download the webjar automatically, you need to restart the webserver either it's an embeded Tomcat or something else so the new dependency gets loaded.

Continue reading