tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yaakov Chaikin <yaakov.chai...@gmail.com>
Subject Re: JSP processing other than .jsp?
Date Wed, 16 Nov 2005 17:29:26 GMT
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 <lehmann@cnm.de> wrote:
> Hello,
>
> how can I define, that e.g. the extension .css shall be processed by
> tomcat same as a .jsp-file?
>
> Regards
> Marten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@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