2013/7/13 Alireza Fattahi <afatt...@yahoo.com>:
> 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
>
>


1.
<jsp-config>
<jsp-property-group>
<url-pattern>*.css</url-pattern>
<default-content-type>text/css</default-content-type>
</jsp-property-group>
</jsp-config>

Adding above to your WEB-INF/web.xml should both implicitly map your
*.css files to a JSP servlet (no explicit servlet-mapping is needed)
and set default content-type for them.

2. mime-mapping is useless here. It is used when serving static
resources (be DefaultServlet) only.

Moreover, such mapping is already present in conf/web.xml (which
provides site-wide defaults). That is if you are using 7.0.42. You
have not mentioned your version of Tomcat.

3. Top-posting is bad.
http://tomcat.apache.org/lists.html#tomcat-users
-> "6."

Best regards,
Konstantin Kolinko

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

Reply via email to