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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s