The problem is that the browser is requesting the file from the web
server with an incorrect URL. Since you did not put a leading directory
separator in the HREF, my guess is that the page request is being
interpreted as http://{your server}/servlet/StyleSheet.css.
One way to get this to work correctly is to put the style sheet
somewhere in the document root of the web server. For example, if
requests to get http://{your server}/somePage.html get the page
/webroot/pages/somePage.html, then put the StyleSheet.css file in
/webroot/pages/ and add a leading slash to the HREF:
HREF="/StyleSheet.css". If you put the style sheet in a subdirectory
under the root, adjust the href accordingly.
Another way to solve this problem is to construct an absolute URL for
the HREF tag. Instead of HREF="/StyleSheet.css" use HREF="http://{your
server}/StyleSheet.css"
K Mukhar
"Shivashis Bose" wrote:
>
> Hi
>
> In our project, we have a common style sheet file for a number of HTML pages.
> These pages are being generated by a servlet. The style sheet file is included
> using "<link REL="STYLESHEET" HREF="StyleSheet.css" TYPE="text/css">. On
> invoking the servlet an error message is thrown by the servlet for this line.
> The message is something like cannot find "StyleSheet.css".
>
> If I am including the style sheet code withing the servlet code, it works fine.
> I guess the servlet is not able to load the style sheet file or is not able to
> send the style sheet file to the client.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html