I'm using tomcat 8. My css and js files do not load into jsp through the $ pagecontext.request.contextpath in tomcat8. I can only load the css if I put the absolute path from the webapp directory. Ex (pages / css / style.css).
The project structure is as follows:
src
webapp
pages
css
js
Note: My jsp files are in the same hierarchy as the js and css folders.
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Yellow Pages</display-name>
<welcome-file-list>
<welcome-file>paginas/index.jsp</welcome-file>
</welcome-file-list> ...
The Head of jsp:
<link type="text/css" href="${request.contextPath}css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" href="${request.contextPath}css/bootstrap-theme.min.css" rel="stylesheet">
Any help is welcome, thanks!