Friday, 23 August 2013

${pageContext.request.contextPath} does not working

${pageContext.request.contextPath} does not working

I'm using tomcat 7.0. Now I am facing an issue that could not load the css
and js file. trying to add ${pageContext.request.contextPath} but does not
work, also tried c:url tag, but getting syntax error in eclipse.
The structure of these files is:
WebContent
-content/css/lab3.css
html and js folder are under content folder as well
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID"
version="3.0">
<display-name>lab3</display-name>
<welcome-file-list>
<welcome-file>/content/html/lab3.html</welcome-file>
</welcome-file-list>
</web-app>
Here is the html head:
<link rel="stylesheet" type= "text/css" href=
"${pageContext.request.contextPath}/css/lab3.css" media="screen,
projection">

No comments:

Post a Comment