I installed SpringSource Tool Suite 2.8.0. I am trying to include a JS file in a JSP using the Spring MVC template as a starting point. My JSP looks like this:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<html>
<head>
<title>Home</title>
<script type="text/javascript" src="/a.js"></script>
</head>
<body>
Hello world!
</body>
</html>
a.js is under src \ main \ resources and looks like this:
window.alert("A");
The result is "Hello world!" printed without warning: - (
I tried to put the JS file in different places by changing src with / without "/" and even adding the servlet mapping in web.xml to use the default servlet for "* .js". Nothing is working.
What am I doing wrong?
source
share