I think the essential problem in the css is the client is attempting to guess the location of the css based on a relative URL and the address of the main page. You could try giving it an absolute path:

${pageContext.request.contextPath}/myStyles.css

The client will receive an absolute path to the css file on your server. Added benefit is the webapp can be deployed under any number of paths and still provide the correct absolute path to the css.

--David

Robbert wrote:

Caldarale, Charles R wrote:
From: Robbert [mailto:[EMAIL PROTECTED] Subject: Re: CSS not being used when a Servlet is involved

I'm using a link tag. It works fine if I take out the lines in web.xml that define the Servlet + Servlet Mapping. But if
I add them back, it doesn't work anymore.
Does your mapping use "/"?  This means the servlet will be invoked for
every request to the webapp that isn't handled by some other mapping.
Perhaps you need to change it to be more specific.

- Chuck



My Servlet-mapping (if you mean that) is as follows:

<servlet-mapping>
 <servlet-name>StatistiekServlet</servlet-name>
 <url-pattern>/</url-pattern>
</servlet-mapping>

Here's something someone else posted:

<quote="David Smith-2">
2. How are you including the css -- inline or via a <link.... > tag?  If
via a <link ....> tag, that is pulled via a separate request to the server.
Combining that with what you just said, I assume that you're basically
saying that my servlet tries to handle the <link ...> tag that contains the
URL to my CSS, but fails miserably in the process?
If so, then how do I change my web.xml file in such a manner that the
Servlet leaves the CSS alone? I've tried reading the template web.xml.txt file, but I'm still relatively
new to this so I'm not sure just what to do to change it so that it leaves
the CSS alone.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to