Servlets and CSS

hi

I am writing some servlets and I want to use css as well for my html forms, when i try to use the following code in my servlet, it doesn't recognise the line at all

<code>

out.println(" <html> <head> <title>Task Manager </title>");

out.println("<STYLE type=\"text/css\"><!--@import url(task_css.css);--></STYLE> ");

out.println("</head> <body link=\"#006699\" VLINK=\"#008080\" ALINK=\"#FFFFFF\">");

</code>

Is it possible to for the servlets to unserstand this line?

[593 byte] By [Shellers] at [2007-9-26 3:24:16]
# 1
Your servlet needs to aswer the request for the style sheet, because the base of the request is derived from the URI used to request the document from your servlet.
MartinS. at 2007-6-29 11:43:43 > top of Java-index,Archived Forums,Java Programming...
# 2
try with the link element: <link type=text/css rel=stylesheet href=task_css.css>
jsalonen at 2007-6-29 11:43:43 > top of Java-index,Archived Forums,Java Programming...
# 3

thanks for all the help, but i am having still no luck! i have viewed the source of the servlet when running in the browser and saved this code as a html doc with the css file in the same dir, and the code is correct and the stylesheet is working.

Do I have to put the stylesheet in a different directory, I have it stored in my web folder, along with the html files and servlets.

It does not seem to recognise where i store my css file at all.

tnx in advance.

Shellers at 2007-6-29 11:43:43 > top of Java-index,Archived Forums,Java Programming...
# 4
So you mean that your web browser can tell the difference between static HTML and identical HTML produced by a servlet? Are you absolutely sure? Maybe this is a path problem -- what if you try a absolute path for the CSS?
jsalonen at 2007-6-29 11:43:43 > top of Java-index,Archived Forums,Java Programming...
# 5
ok, worries over out.println("<link type=text/css rel=stylesheet href=\"/task_css.css\"> ");I wasnt using the '/' in front of the stylesheet. sorry guys!thanks for all the help...
Shellers at 2007-6-29 11:43:43 > top of Java-index,Archived Forums,Java Programming...