Dumb Fella Dumb Fella - 9 months ago 29
Javascript Question

Unable to load js in spring mvc

Unable to load js

JSP file

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<spring:url value="/resources/home.js" var="homeJS" />
<script src="${homeJS}"></script>




<mvc:resources mapping="/resources/**" location="/resources" />
<mvc:annotation-driven />

I am getting HTTP Status 404
The url that it is trying to access is http://localhost:8080/Test/resources/home.js


The problem was web.xml. Modified it to :


Now working fine