tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <>
Subject Re: JSP processing other than .jsp?
Date Wed, 16 Nov 2005 17:49:47 GMT
FYI, I had a case once where I needed to make my CSS files JSP's because 
I was using HTC's and for some reason I couldn't get the path mappings 
to work right unless I used request.getContextPath() to prefix the HTC 
names... more than likely just my mistake somewhere, but making it a JSP 
(as Yaakov says, just renaming it to .jsp) did the trick.

I would personally prefer that approach because should you ever need to 
move to another app server, or even a hosted environment like I moved to 
a few months back, this way you won't have to mess with server settings, 
or getting some grumpy old admin to do it :)


Yaakov Chaikin wrote:
> I assume you need this because you want to place some JSP code inside
> your stylesheet....
> Two approaches:
> 1) If you know that ALL of your .css files will need to include JSP
> code in them, then go to tomcat_dir/conf/web.xml and add another
> <servlet-mapping> like so:
> <servlet-mapping>
>   <servlet-name>jsp</servlet-name>
>    <url-pattern>*.css</url-pattern>
> </servlet-mapping>
> 2) If you need to place JSP code in just one or two .css files, I
> would not start messing with server specific configurations and just
> rename those .css files to have extension of .jsp. So, now you will
> have a stylesheet file with .jsp. It seems weird and unusual, but
> really doesn't make any difference as far as your HTML/JSP page is
> concerned. Just point the link to the .jsp page instead in your
> HTML/JSP page:
> <link href="styles/myStyle.jsp" rel="stylesheet" type="text/css">
> Hope that helps.
> Yaakov.
> On 11/16/05, Marten Lehmann <> wrote:
>>how can I define, that e.g. the extension .css shall be processed by
>>tomcat same as a .jsp-file?
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
AIM: fzammetti
Yahoo: fzammetti

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message