[EMAIL PROTECTED] wrote:
I have problem to show chinese characters stored in MySQL database with
use of struts bean tag. Data is read out using Hibernate. When I call
myHibernateObject.getMyProperty() method - everything works fine. But
using <bean:write name="myHibernateObject" property="myProperty"/> does
show text in this notation: &#xxxx &#xxxx. Same problem occurres when I
use this bean in struts form with <html:text name="myHibernateObject"
property="myProperty"/>

Encoding of database is set up properly to gb2312. JSP page uses UTF-8
encoding. How can I set character encoding for struts bean tag ? Or
where
is the problem ?
How are you verifying that what you get back from the database is
correct? If anywhere in the data retrieval pipeline is using the wrong
encoding, you'll get corrupted data. Try hard-coding an output value to
see if you are able to display that correctly.

If that fails, it must be something in the way you've written your JSP;
make sure that you have the UFT-8 charsett declared in the content type
of the response -- e.g. with <%@ page contentType="text/html;
charset=UTF-8"%> and/or HTML META-tags.

L.


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




I have verified it with <%=myObject.getProperty()%> in the JSP. In this
case I got chinese string with right encoding. But using <bean:write
name="myObject" property="property"/> produces string in this wrong
encoding format: &#xxxx. Charset of the JSP page is set to UTF-8.

In that case I'm not sure what's going on... Can you post a short JSP fragment that demonstrates the problem?

L.


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

Reply via email to