You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pham Anh Tuan <an...@ichi-corp.jp> on 2005/04/13 08:40:51 UTC

[HELP] tag can not write Japanese or Vietnamese

Hi all,

I got a problem when I write out data on jsp.

I have a String = "&#12431;&#12383;&#12375"

which means わたし in Japanese

I use <bean:write name="myStr"/>

it only shows "&#12431;&#12383;&#12375"

plz show me how to solve this problem.

thanks.

Re: [HELP] tag can not write Japanese or Vietnamese

Posted by delbd <de...@oma.be>.
How about using the java capabilities to store unicode string and just let the 
bean:write do the necessarry convertion to html form?

String myStr= "\u308f\u305f\u3057";
<bean:write name="myStr"/>

see
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#44591
for details on unicode characters in source code.

-- 
David Delbecq
Royal Meteorological Institute of Belgium
Le Mercredi 13 Avril 2005 14:49, Jeff Beal a écrit :
> The <bean:write/> tag, by default, escapes any HTML special
> characters, like the '&' in your case.  This can be an important
> security consideration to prevent malicious users of your site from
> injecting HTML markup into your website.  To override this behavior,
> set filter="false":
>
>  <bean:write filter="false" name="myStr"/>
>
> On 4/13/05, Pham Anh Tuan <an...@ichi-corp.jp> wrote:
> > Hi all,
> >
> > I got a problem when I write out data on jsp.
> >
> > I have a String = "&#12431;&#12383;&#12375"
> >
> > which means わたし in Japanese
> >
> > I use <bean:write name="myStr"/>
> >
> > it only shows "&#12431;&#12383;&#12375"
> >
> > plz show me how to solve this problem.
> >
> > thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [HELP] tag can not write Japanese or Vietnamese

Posted by Jeff Beal <jb...@gmail.com>.
The <bean:write/> tag, by default, escapes any HTML special
characters, like the '&' in your case.  This can be an important
security consideration to prevent malicious users of your site from
injecting HTML markup into your website.  To override this behavior,
set filter="false":

 <bean:write filter="false" name="myStr"/>

On 4/13/05, Pham Anh Tuan <an...@ichi-corp.jp> wrote:
> Hi all,
> 
> I got a problem when I write out data on jsp.
> 
> I have a String = "&#12431;&#12383;&#12375"
> 
> which means わたし in Japanese
> 
> I use <bean:write name="myStr"/>
> 
> it only shows "&#12431;&#12383;&#12375"
> 
> plz show me how to solve this problem.
> 
> thanks.
> 


-- 
Jeff Beal
Webmedx, Inc.
Pittsburgh, PA USA

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [HELP] tag can not write Japanese or Vietnamese

Posted by Sunny <su...@collab.net>.
Try this out:

<bean:define id = "myLocale" name = "request" property = "locale" scope =
"session"/>
<bean:write name = "myStr" locale="myLocale"/>

NOTE: Assuming browser locale is Japanese.


-----Original Message-----
From: Pham Anh Tuan [mailto:anhtuan@ichi-corp.jp] 
Sent: Wednesday, April 13, 2005 12:11 PM
To: Struts Users Mailing List
Subject: [HELP] <bean:write> tag can not write Japanese or Vietnamese

Hi all,

I got a problem when I write out data on jsp.

I have a String = "&#12431;&#12383;&#12375"

which means わたし in Japanese

I use <bean:write name="myStr"/>

it only shows "&#12431;&#12383;&#12375"

plz show me how to solve this problem.

thanks.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org