How to add Static file (js,css,img) to Spring MVC


Here is how to add javascript/static files to the Spring MVC web project

*if you are looking for job click here

Spring MVC Javascript
Spring Javascript static files

     <mvc:resources mapping=”/resources/**” location=”/resources/” />

 

SpringMVCVIEW

<script type=”text/javascript” src=”<c:url value=”/resources/js/yusuf.js” />” ></script>

Url to access :

http://localhost:8080/BelajarGetPost/resources/js/yusuf.js

 

Spring MVC add javascript, Spring add CSS, Spring MVC add Static file, Spring MVC javascript 404

4 thoughts on “How to add Static file (js,css,img) to Spring MVC

Leave a comment