Click to See Complete Forum and Search --> : CSS is not taking effect


romsok
09-22-2009, 03:20 PM
Sorry, another Noob question here:

I have a Java Web App with the following dir structure:

appRoot
appRoot/CSS/myStyle.css
appRoot/WEB-INF/JSP/HomePage.jsp

HomePage.jsp has this:

<link rel="stylesheet" type="text/css" href="../../CSS/myStyle.css" />

But for some reason, when this JSP gets served, the stylesheet is not taking effect, and I can't figure out why.

I have a feeling it's something stupid and small that I missed.

romsok
09-22-2009, 03:59 PM
The issue was that I was assuming the path to the CSS resource is relative to the JSP location. Instead, it should be relative to the app context root location.

href="CSS/myStyle.css"

Instead of:

href="../../CSS/myStyle.css"