Working on a web project using servlets and JSP in IntelliJ. One of the JSP files manages graphics and user forms with graphics.js
handling graphics and form validation done by validator.js
.
The issue I'm facing is that while Tomcat can locate graphics.js
, it fails to find validator.js
. Despite both files being in the same folder, I receive a 404 error message stating that validator.js
cannot be found.
I would appreciate some insight into this peculiar situation as similar queries didn't provide a solution. Apologies if this has been addressed before.
Project Structure:
src
ControllerServlet.java
AreaCheckingServlet.java
web
css
style.css
js
graphics.js
validator.js
WEB-INF
Form.jsp
web.xml
Snippet from Form.jsp:
<script src="${pageContext.request.contextPath}/js/graphics.js"></script>
<script src="${pageContext.request.contextPath}/js/validator.js"></script>
Here's part of graphics.js for reference:
function draw(side, r, mar) {
...
}
And here's the placeholder content of validator.js:
function validate() {
console.log("Debugging message: Validation done successfully")
}
I've tried various approaches like changing file paths, URLs, and even direct access via URL to no avail. Any suggestions or assistance would be highly appreciated.
Update: Attempted rebuilding/cleaning artifacts and recreating the entire project to solve the issue without success.