tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Dawson <tdaw...@wamnet.com>
Subject RE: I18N Tag Q
Date Tue, 11 Sep 2001 22:52:19 GMT
> My question, is that OK... Meaning, does the response.setContentType()
> method overwrite the content-type set by the tag "<i18n:bundle
> baseName=...".

I just noticed the comment you're looking at is overly broad... it should
only set the character set portion of the content type.  regardless, your
subsequent call should work fine, providing its done before a call to
getWriter (which happens without your control, presumably when the response
buffer fills up the first time).  if you're not messing with the character
set in the content type, I'd set that before the bundle tag...

you might also watch out for using an incompatible charset/locale combo...
e.g. having a Locale of "ja" for your bundle tag and overriding the charset
to "ISO-8859-1" will give you all sorts of problems...

on a separate note, I did send out a proposal to the dev alias to modify the
bundle tag to allow turning off the locale setting behavior; this may be
useful to you when those updates are incorporated...

Tim


> -----Original Message-----
> From: Ratnakar Palle [mailto:rpalle@cisco.com]
> Sent: Friday, September 07, 2001 4:29 PM
> To: taglibs-user@jakarta.apache.org
> Subject: I18N Tag Q
> 
> 
> Hi All,
> 
> I've a  question about usage of the tag "<i18n:bundle baseName= ..."
> 
> I'm using model 2 architecture, i.e. request comes to 
> servlet, servlet does
> the process and creates the bean and forwards it to JSP. 
> Finally, jsp sends
> the response to the client.
> Also, I'm using the i18n tags in the jsp. I'm doing something 
> like this:
> 
> <%@ page language="java" %>
> <jsp:useBean id="controller" scope="request"
> class="apps.test.LoginController" ></jsp:useBean>
> <%@ taglib uri="http://jakarta.apache.org/taglibs" prefix="i18n" %>
> <i18n:bundle baseName="apps.test.text.resources.LoginRB" locale="<%=
> controller.getLocale() %>" />
> <% response.setContentType("text/html;charset=" + 
> controller.getCharset());
> %>
> 
> I went through the i18n taglib documentation and found that tag
> "<i18n:bundle baseName=.." sets the content type based on the 
> locale we pass
> as argument.
> But, I don't want that to happen.
> I want to set the content-type that is returned by my databean. So, am
> calling the response.setContentType() right after the tag 
> "<i18n:bundle
> baseName=...".
> My question, is that OK... Meaning, does the response.setContentType()
> method overwrite the content-type set by the tag "<i18n:bundle
> baseName=...".
> 
> Thanks in advance...
> 
> -Ratnakar
> 

Mime
View raw message