Spring MVC static file include

Spring MVC static file include

In this demo you will see how to include static folder path and add its file dynamically in Spring MVC application. For this demo we will create sample jsp page and add static css file in it. This application can also use as RESTFul service:

  • Create maven project name: SpringMVCHTMLReturn
  • Final project structure:

Spring MVC static file include

  • web.xml:

  • dispatcher-servlet.xml

  • index.jsp:

  •  SpringMVCController.java:

  • Web page output:

Spring MVC static file include

Spring MVC static file include

Spring MVC static file include

For more information on URL mapping please read this tutorial 

download Download Project:  SpringMVCHTMLReturn

 

 

2 thoughts on “Spring MVC static file include

Leave a Reply

Your email address will not be published. Required fields are marked *