Reputation: 1712
i have a very simple webapp and cannot get .js and .css files from the server by <script>
and <link>
tags.
error: GET http://localhost:8080/resources/js/lib.js 404 (Not Found)
this is my index.jsp:
<html>
<head>
<jsp:include page="/pages/general/scripts.jsp"/>
</head>
<body>
...
</body>
</html>
this is scripts.jsp:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="/resources/js/lib.js"></script>
<link rel="stylesheet" type="text/css" href="/resources/css/style.css">
my files:
what am i doing wrong here?
EDIT: btw, i checked and i can easily reach the files by their url. if i access localhost:8080/myApp/resources/js/lib.js then i see the file's content.
Upvotes: 0
Views: 4378
Reputation: 10677
<script type="text/javascript" src="/resources/js/lib.js"></script>
I suspect path is not proper. Try something like src="./resources/js/lib.js"
Upvotes: 1