jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Dawson" <tdawso...@yahoo.com>
Subject RE: Re[2]: Programer-defined Locale->charset mapping (was: Re[2]: standard/fmt or i18n the problem is still there)
Date Thu, 24 Jan 2002 20:28:09 GMT
>        <i18n:contentType contentType="text/xml"/>

I like this better -- it provides more fine-grained control, and would be
easier to remove when the servlet spec is updated to fix the underlying
problem.

By default it would use the current response locale to do the lookup
(meaning you first declare <i18n:bundle> or <i18n:locale> and THEN use
<i18n:contentType>). I'll also add an attribute for locale like the bundle
tag has.

I had it working under my original proposal (actually saw some cyrillic
chars!); I'll update it to use this.

Tim

> -----Original Message-----
> From: Anthony Tagunov [mailto:tagunov@newmail.ru]
> Sent: Thursday, January 24, 2002 7:21 AM
> To: Tim Dawson
> Cc: 'Tag Libraries Developers List'
> Subject: Re[2]: Programer-defined Locale->charset mapping (was: Re[2]:
> standard/fmt or i18n the problem is still there)
>
>
> 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
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
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