Use Spring Tag Library to resolve the same, on your JSP page include the tag library and provide the folder path (where your js files are present) as value to <spring:url>
, as follows:
JSP Page:
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!doctype html>
<html>
<head>
<spring:url value="/js/kurento-utils.js" var="kurentoUtils" />
<script src="${kurentoUtils}"></script>
</head>
In your Spring Configuration file add <mvc:default-servlet-handler />
to load *.js
files.
springdispatcher-servlet.xml:
<mvc:default-servlet-handler />
And make sure your have spring-web
and spring-webmvc
dependencies in your classpath
, mentioned below:
pom.xml:
<properties>
<spring.version>4.1.4.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>