views:

591

answers:

3

Hey! I have made a webpage in Servlet and now i want to add a stylesheet.css to it Where should i exactly put the .css file ? like in ROOT of tomcat or some where else and what exact path i have to use??

link href='style.css' rel='stylesheet' type='text/css'

Thanks Sundhas

A: 

Since you are using a relative path, it should be in the same location as your jsp. If you write your HTML in the Servlet, it should be placed in the root of the webapp.

Dominik
yes that .css resides in Root folder but still its not wroking :Sdo i need to change somehthing in this path? i mean while attaching style sheetlink href='style.css' rel='stylesheet' type='text/css'like some path in href= "" ???
Sundhas
A: 

Put the file somewhere in WebContent. There where your JSP files also are. Or did you abuse the Servlet to generate the HTML output? Well, at least, the public files needs to be placed in the WebContent folder. The folder name might differ from environment to environment, but it is at least the very same root folder where the WEB-INF folder resides. You normally place public content there.

BalusC
A: 

Thanks EveryOne! I figured this out

Well actually you don't have to paste the FILE.CSS in Root of tomcat you actually have to paste the .css file where your netbeans Projects reside for example C://Documents and settings/NetbeansProject/ProjectName/Web Paste the .Css over there

and so this remains same : link href='style.css' rel='stylesheet' type='text/css'

~Sundhas~

Sundhas