On Thu, 14 Nov 2002, Huynh Ngoc Huy wrote:

>   I'm using struts version 1.1b2. The followings are
> my snippet codes:
>
> *********  struts-config.xml *********
>   ...
>   <form-bean name="aForm"
>
> type="org.apache.struts.action.DynaActionForm">
>     <form-property name="msg"
>                    type="java.lang.String"/>
>   ...
>   <action path="/aPath"
>           type="anAction"
>           name="aForm">
>     <forward name="target" path="/result.jsp"/>
>   </action>
>   ...
>
> *********  anAction.java *********
>   ...
>   String s = <a unicode-string from mysql database>;
>   PropertyUtils.setSimpleProperty(form, "msg", s);
>   ...
>   return mapping.findForward("target");
>
> *********  index.jsp *********
>   <%@ taglib uri="/WEB-INF/struts-html.tld"
>       prefix="html" %>
>
>     <html:link page="/aPath.do">go</html:link>
>
> *********  result.jsp *********
>   <%@ taglib uri="/WEB-INF/struts-html.tld"
>       prefix="html" %>
>
>   <html:form action="/aPath.do">
>     <html:textarea property="msg" cols="30" rows="5"/>
>   </html:form>
>
> *****************************************************
>
>   In the result.jsp, the textarea cannot display the
> unicode-string correctly.

What do you mean by "unicode-string"? Strings in Java are always Unicode.
Perhaps you mean a string that contains non-Latin characters? If that's
the case, you'll need to specify the encoding you want in the JSP page.
The pages above do not specify an encoding, so they are defaulting to
ISO-8859-1, which may not be what you want.

Also, I've seen a couple of people mention problems related to storing
non-Latin characters in a MySql database. I don't use MySql, so I can't
help you with that, but you'll probably find more information in the
mailing list archives.

--
Martin Cooper


>   Any help is appreciated !
>   Thanks in advance,
>   Huy
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to