Jsp 找不到js和css资源-获取404
我有一个非常简单的webapp,无法通过Jsp 找不到js和css资源-获取404,jsp,web-applications,Jsp,Web Applications,我有一个非常简单的webapp,无法通过和标记从服务器获取.js和.css文件。 错误:GEThttp://localhost:8080/resources/js/lib.js 404(未找到) 这是我的index.jsp: <html> <head> <jsp:include page="/pages/general/scripts.jsp"/> </head> <body> .
和
标记从服务器获取.js和.css文件。
错误:GEThttp://localhost:8080/resources/js/lib.js 404(未找到)
这是我的index.jsp:
<html>
<head>
<jsp:include page="/pages/general/scripts.jsp"/>
</head>
<body>
...
</body>
</html>
...
这是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">
我的文件:
我做错了什么
编辑:顺便说一句,我检查过了,我可以很容易地通过他们的url找到这些文件。如果我访问localhost:8080/myApp/resources/js/lib.js,那么我会看到文件的内容。
<script type="text/javascript" src="/resources/js/lib.js"></script>
我怀疑这条路不对。尝试类似于src=“/resources/js/lib.js”