tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ing. Gabriel Gajdos" <Gabriel.Gaj...@ses.sk>
Subject RE2: Jsp compile option for Big5 encoding / encoding question
Date Mon, 03 Dec 2001 08:41:39 GMT
Craig (or somebody else), could you, please, give me a hint in following question?

| JSP pages follow these rules:
| 
| * If you declare a "pageEncoding" attribute on your <%@ page %>
|   directive (supported in JSP 1.2 only), that character set is used
|   to read the text of the page itself (as the page is being compiled).
| 
| * The character encoding from the contentType attribute of the
|   <%@ page %> directive is used, if present

I know and use these settings...
But:
Is it possible to have SINGLE JSP page with *variable* encoding/Content Type?

<%@ page contentType="text/html; charset=XY" %>

And I want to set the Content Type (or charset/encoding) according to *current* conditions.
For example acording to a field value from database, or Property from .properties file with
language dependent settings.

Is this possible in T4? IMHO JSP specifications do not say about this.

I would like to make something similar (this syntax is NOT correct):

<%@ page contentType="p.getProperty("ContentType")" %>

I also tried a custom tag solution, but with no success.
It seams, directives bitween <%@ %> directives can not contain executable code.

Of course, this approach works when using servlet (I mean variable ContentType).
So can this also be done in JSPs?
Or in this case is the only way to do it by using Unicode?

Thanx in advance.

GG


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message