I have a folder, “js”, inside my WEB-INF folder and it holds javascript files. I can’t get the server to retrieve them using the url localhost:8084/appname/js/file.js but everything else defined in my web.xml file works fine.
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<servlet>
<servlet-name>MeasurementNodesController</servlet-name>
<servlet-class>com.mycompany.MeasurementNodesController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MeasurementNodesController</servlet-name>
<url-pattern>/MeasurementNodes</url-pattern>
</servlet-mapping>
<resource-ref>
<res-ref-name>jdbc/datasource</res-ref-name>
<res-ref-type>javax.sql.DataSource</res-ref-type>
</resource-ref>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
Anything in the WEB-INF folder is unavailable to the outside world. WEB-INF is only available internally for Forwards and such.
You’ll need to move the JS out of WEB-INF to be able to use it.