1
I am using Tomcat 8. My css and js files do not load into jsp via $pagecontext.request.contextpath in tomcat8. I can only load css if I set the absolute path from the webapp directory. Ex(pages/css/style.css).
The structure of the project is as follows:
src
webapp
pages
css
js
Obs: My jsp files are in the same hierarchy as 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 the 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, thank you!
After trying, I found that it was being rendered as text. Thank you!
– Cadudragon