tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robbert <robbert.ouweh...@gmail.com>
Subject RE: CSS not being used when a Servlet is involved
Date Sat, 28 Oct 2006 11:04:33 GMT


Caldarale, Charles R wrote:
> 
>> From: Robbert [mailto:robbert.ouwehand@gmail.com] 
>> Subject: RE: CSS not being used when a Servlet is involved
>> 
>> 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?
> 
> Yes, that's what I think is going on.
> 

Hm, alright. Should all else fail, is it possible to let a Servlet handle
the CSS?


Caldarale, Charles R wrote:
> 
>> If so, then how do I change my web.xml file in such a manner that the
>> Servlet leaves the CSS alone? 
> 
> I don't know how your app is architected, so I don't know if you want
> nearly all URI references to go to the StatistiekServlet, or just
> specific ones.  If it's just specific, use those on the <url-pattern>,
> rather than just a slash.  
> 
> 
I have four JSP pages (index, profile, statistics and gallery) that must
invoke the StatistiekServlet. The page is simply a normal, static HTML page
that calls the Servlet. Then the Servlet catches certain HTTP Headers and
query strings and does stuff depending on the values. When the Servlet's
finished, the JSP continues spitting out HTML code.
And if I do that, it says "Resource not available: /StatistiekServlet" for
whatever reason.


Caldarale, Charles R wrote:
> 
> If StatistiekServlet should process
> everything but the .css files, try putting this in your web.xml:
> 
>     <servlet>
>         <servlet-name>tcdefault</servlet-name>
>  
> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-clas
> s>
>     </servlet>
> 
>     <servlet-mapping>
>         <servlet-name>tcdefault</servlet-name>
>         <url-pattern>*.css</url-pattern>
>     </servlet-mapping>
> 
> This would be in addition to what you already have.
> 
>  - Chuck
> 
> P.S. This thread is converging with another one from today...
> 

That works! Thank you very much! 
Are there any drawbacks to this method?
-- 
View this message in context: http://www.nabble.com/CSS-not-being-used-when-a-Servlet-is-involved-tf2521410.html#a7047719
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Mime
View raw message