Hi,

My situation is this:
The site which i work should work in RTL and LTR modes ( I am using YAML for 
layout)

The site.css should have this for LTR:

@import url(../yaml/navigation/hlist.css);
@import url(../yaml/forms/gray-theme.css);
@import url(../yaml/screen/typography.css);
@import url(../yaml/screen/screen-FULLPAGE-layout.css);

for RTL it must have

@import url(../../yaml/add-ons/rtl-support/core/base-rtl.css);
@import url(../../yaml/add-ons/rtl-support/navigation/hlist-rtl.css);
@import url(../../yaml/add-ons/rtl-support/forms/gray-theme-rtl.css);    


So I want to path a parameter to CSS and do some thing like this:

http://www.mysite.com/site.css?direction=rtl

and in the CSS
@import 
url(../../yaml/add-ons/rtl-support/core/base-<%=request.getParameter("direction")%>.css);


I donot want to to use if parameters in the jsp and do some thing like this:
if request.getParameter("direction")="RTL"
{
<link href="styles/site-rtl.css" rel="stylesheet" type="text/css" />

}
else{
<link href="styles/site-ltr.css" rel="stylesheet" type="text/css" />

}


The problem is that, although you set the mime type of css to text/css in 
web.xml. it does not take effect.
I just find a bad work around which you must put <%@page contentType="text/css" 
%>in top of all css files

 
~Regards,
~~Alireza Fattahi


________________________________
 From: André Warnier <a...@ice-sa.com>
To: Tomcat Users List <users@tomcat.apache.org> 
Sent: Saturday, 13 July 2013, 14:21
Subject: Re: JSP in Static Resources
 

Alireza Fattahi wrote:
> Hi,
> 
> I want to add some jsp code in to my site.css.

Maybe it is just me, but that does not seem to make any sense.
Usually, it would be the other way around.
Can you explain why you want to do this ?

The idea of JSP is to have Java code which in the end produces a HTML page 
which is sent 
to the browser.  The JSP is compiled into a servlet, which is executed when the 
browser 
"calls" that JSP page. The servlet produces HTML, which is sent the browser.
The HTML page may contain links to CSS stylesheets, Javascript libraries etc.
The browser retrieves these directly, as static objects, when it finds a link 
in the HTML.
A CSS stylesheet is meant to provide instructions to the browser, about how to 
/render/ 
(display nicely) the final product, which is the HTML page (produced by the 
JSP/servlet).
I cannot really imagine a scenario in which having Java code in there would 
make any 
sense.  At the very least, that would make the later maintenance of that 
application 
hopelessly confusing.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to