jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Tagunov <tagu...@newmail.ru>
Subject Re[2]: Programer-defined Locale->charset mapping (was: Re[2]: standard/fmt or i18n the problem is still there)
Date Thu, 24 Jan 2002 13:20:56 GMT
Hello Tim,

Wednesday, January 23, 2002, 9:42:52 AM, you wrote:

TD> One hitch with this:
>> > TD>   <context-param>
>> > TD>     <param-name>
>> > TD>       org.apache.taglibs.i18n.CharsetMap.ru
>> > TD>     </param-name>
>> > TD>     <param-value>
>> > TD>       ISO-8859-5
>> > TD>     </param-value>
>> > TD>   </context-param>

TD> I can't simply update the charset, because there's also no way to set the
TD> charset without overriding the content type. Further, there's no way through
TD> the Servlet API to determine what the current content type is on a response
TD> (of course its not safe to assume "text/html").  So I can't even grab the
TD> current content type & replace the charset.
Very much true.

TD> So I've had to make a few minor changes; it will have to look more like
TD> this:
>> > TD>   <context-param>
>> > TD>     <param-name>
>> > TD>       org.apache.taglibs.i18n.ContentTypeMap.ru
>> > TD>     </param-name>
>> > TD>     <param-value>
>> > TD>       text/html; charset=ISO-8859-5
>> > TD>     </param-value>
>> > TD>   </context-param>

TD> Unless someone has a better idea... which I'd be very glad to hear.

A couple more ideas:

2)     extra parameter to the <bundle> and <locale> tags:
       <bundle .. contentType="text/xml"/>


       maybe <message>,<numberFormat>,<dataFormat> tags also
       are allowed to have the contentType parameter, if they
       are allowed to set the Locale/charset?


3)     a special parameter in the request scope.

       to avoid adding the contentType parameter to all the tags
       that may potentially need it we put it into a request
       parameter.
       
       to set it we may introduce an extra tag:

       <%@ page %>
       <i18n:contentType contentType="text/xml"/>
       <i18n:bundle>
       ...
       </i18n:bundle>

-- 
Best regards,
 Anton Tagunov                            mailto:tagunov@newmail.ru



--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message