Dumb Fella Dumb Fella - 1 year ago 88
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

Answer Source

The problem was web.xml. Modified it to :


Now working fine

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download