Solved - Static Resources(css/js/images) Not Found(404)

Last Updated on: February 8, 2021 pm

Solved - Static Resources(css/js/images) Not Found(404)

Problem

Not Found

Solution

Set as Resources Folder

Add following config into /WEB-INF/spring-mvc-crud-demo-servlet.xml

1
2
<!--	Add support for reading web resources: css, images, js -->
<mvc:resources mapping="/resources/**" location="/resources/"/>

Make sure set the Tomcat Configuration to Update Classes and Resources.

Update classes and resources

Make sure the resources folder is deployed in the out/artifacts path and is updated everytime the jsp or css file is modified.

Output Artifacts

Reference: Udemy, Spring & Hibernate for Beginners (including SpringBoot)