You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christian Martin <ch...@joanneum.at> on 2003/10/16 17:33:18 UTC

[newbie] how does work?

sorry i did a mistake in my code snipplet but it does not work either.

the corrected version:

the code snippet below works fine and i can see the message for the key 
message.example.simple from my ResourceBundle
<code>
 <fmt:bundle basename="ApplicationResources">
   <fmt:message key="message.example.simple" />
 </fmt:bundle>
</code>

but if i use the setBundle tag
<code>
 <fmt:setBundle basename="ApplicationResources" var="ares" />
 <fmt:message bundle="ares" key="message.example.simple" />
</code>

following error occurs
<error>
 An error occurred while evaluating custom action attribute "bundle" 
with value "ares": Attempt to convert String "ares" to type 
"javax.servlet.jsp.jstl.fmt.LocalizationContext", but there is no 
PropertyEditor for that type (null)
</error>

thanks in advance

student from austria
(working on an struts project during internship)

---------------------------------
sorry for my english but i am working hard to improve my english knowledge

Christian Martin wrote:

> the code snippet below works fine and i can see the message for the 
> key message.example.simple from my ResourceBundle
> <code>
>  <fmt:bundle basename="ApplicationResources">
>    <fmt:message key="message.example.simple" />
>  </fmt:bundle>
> </code>
>
> but if i use the setBundle tag
> <code>
>  <fmt:setBundle basename="${ApplicationResources}" var="ares" />
>  <fmt:message bundle="ares" key="message.example.simple" />
> </code>
>
> following error occurs
> <error>
>  An error occurred while evaluating custom action attribute "bundle" 
> with value "ares": Attempt to convert String "ares" to type 
> "javax.servlet.jsp.jstl.fmt.LocalizationContext", but there is no 
> PropertyEditor for that type (null)
> </error>
>
> ---------------------------------
> sorry for my english but i am working hard to improve my egnlish 
> knowledge
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Re: [newbie] how does work?

Posted by Christian Martin <ch...@joanneum.at>.
thanks!!!

sometimes you are not able to see the obvious (code blindness)
that "problem" took me nearly 2 hours

-----------------------------------------------
so much to learn so less time

Kris Schneider wrote:

><code>
>  <fmt:setBundle basename="ApplicationResources" var="ares" />
>  <fmt:message bundle="${ares}" key="message.example.simple" />
></code>
>
>Quoting Christian Martin <ch...@joanneum.at>:
>
>  
>
>>sorry i did a mistake in my code snipplet but it does not work either.
>>
>>the corrected version:
>>
>>the code snippet below works fine and i can see the message for the key 
>>message.example.simple from my ResourceBundle
>><code>
>> <fmt:bundle basename="ApplicationResources">
>>   <fmt:message key="message.example.simple" />
>> </fmt:bundle>
>></code>
>>
>>but if i use the setBundle tag
>><code>
>> <fmt:setBundle basename="ApplicationResources" var="ares" />
>> <fmt:message bundle="ares" key="message.example.simple" />
>></code>
>>
>>following error occurs
>><error>
>> An error occurred while evaluating custom action attribute "bundle" 
>>with value "ares": Attempt to convert String "ares" to type 
>>"javax.servlet.jsp.jstl.fmt.LocalizationContext", but there is no 
>>PropertyEditor for that type (null)
>></error>
>>
>>thanks in advance
>>
>>student from austria
>>(working on an struts project during internship)
>>
>>---------------------------------
>>sorry for my english but i am working hard to improve my english knowledge
>>
>>Christian Martin wrote:
>>
>>    
>>
>>>the code snippet below works fine and i can see the message for the 
>>>key message.example.simple from my ResourceBundle
>>><code>
>>> <fmt:bundle basename="ApplicationResources">
>>>   <fmt:message key="message.example.simple" />
>>> </fmt:bundle>
>>></code>
>>>
>>>but if i use the setBundle tag
>>><code>
>>> <fmt:setBundle basename="${ApplicationResources}" var="ares" />
>>> <fmt:message bundle="ares" key="message.example.simple" />
>>></code>
>>>
>>>following error occurs
>>><error>
>>> An error occurred while evaluating custom action attribute "bundle" 
>>>with value "ares": Attempt to convert String "ares" to type 
>>>"javax.servlet.jsp.jstl.fmt.LocalizationContext", but there is no 
>>>PropertyEditor for that type (null)
>>></error>
>>>
>>>---------------------------------
>>>sorry for my english but i am working hard to improve my egnlish 
>>>knowledge
>>>      
>>>
>
>  
>


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


Re: [newbie] JSTL using different ResourceBundles

Posted by Christian Martin <ch...@joanneum.at>.
hi adam!

i "only" read JSTL IN ACTION of shawn bayern.
it is much more easier to read than the spec.

but thanks for your help! and you are right a look into i18n chapter of 
the JSTL 1.0 spec wouldn't go amiss.

Adam Hardy wrote:

> Have you read the i18n chapter of the JSTL 1.0 spec from Sun? It is 
> quite informative on this issue.



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


Re: [newbie] JSTL using different ResourceBundles

Posted by Adam Hardy <ah...@cyberspaceroad.com>.

Hi Christian,

On 10/20/2003 12:53 PM Christian Martin wrote:
> my questions for now:
> 
> 1) in which scope does <message-resource ... /> store the message resource?

in application scope I think.

> 2) is it possible to access this message resource due EL and how?

Try applicationScope["tst"]

> 3) does <fmt:message bundle="${scope.ctx}" /> need a LocalizationContext 
> or does it also work with a message resource
> 
> i am climbing the learning curve. *lol*

Well on this question, so am I! My best guess is yes, it does. However I 
haven't done this yet. I'm sure you can reference the bundles you create 
with the code shown below. Have you read the i18n chapter of the JSTL 
1.0 spec from Sun? It is quite informative on this issue.

Adam

> 
> --------------------------------------------------------------------------
> sorry i can't stop asking questions. something forces me to keep on asking
> 
> 
> Adam Hardy wrote:
> 
>> On 10/17/2003 02:17 PM Kris Schneider wrote:
>>
>>> One approach you could take would be to create your set of alternate
>>> LocalizationContext instances at application startup and store them in
>>> application scope:
>>>
>>> ResourceBundle countriesBundle =  
>>> ResourceBundle.getBundle("countries", locale);
>>> LocalizationContext countriesCtx = new 
>>> LocalizationContext(countriesBundle, locale);
>>> servletCtx.setAttribute("countriesCtx", countriesCtx);
>>>
>>> ResourceBundle statesBundle =  ResourceBundle.getBundle("states", 
>>> locale);
>>> LocalizationContext statesCtx = new LocalizationContext(statesBundle, 
>>> locale);
>>> servletCtx.setAttribute("statesCtx", statesCtx);
>>>
>>> Then, in your JSP:
>>>
>>> <fmt:message bundle="${applicationScope.countriesCtx}" 
>>> key="message.test">
>>> <fmt:message bundle="${applicationScope.statesCtx}" key="message.test">
>>
>>
>>
>> in web.xml this will set up one as the default so you only need to 
>> programmatically set up the others, so at least for the most-used 
>> bundle you won't have to specify the 'bundle' attribute:
>>
>>   <context-param>
>>     <param-name>
>>       javax.servlet.jsp.jstl.fmt.localizationContext
>>     </param-name>
>>     <param-value>ApplicationResources</param-value>
>>   </context-param>


-- 
--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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


Re: [newbie] JSTL using different ResourceBundles

Posted by Christian Martin <ch...@joanneum.at>.
thanks for the information!!!

BUT i can't stop gathering more information (must be a kind of 
addiction) ;-)

<message-resources key="tst" parameter="test" />
in struts-config.xml
and
<bean:message bundle="tst" key="message" />
works
(i found that out of my own without any help! i am very proud *ggg*)

my questions for now:

1) in which scope does <message-resource ... /> store the message resource?
2) is it possible to access this message resource due EL and how?

3) does <fmt:message bundle="${scope.ctx}" /> need a LocalizationContext 
or does it also work with a message resource

thanks for your help so far.

i am climbing the learning curve. *lol*

--------------------------------------------------------------------------
sorry i can't stop asking questions. something forces me to keep on asking


Adam Hardy wrote:

> On 10/17/2003 02:17 PM Kris Schneider wrote:
>
>> One approach you could take would be to create your set of alternate
>> LocalizationContext instances at application startup and store them in
>> application scope:
>>
>> ResourceBundle countriesBundle =  
>> ResourceBundle.getBundle("countries", locale);
>> LocalizationContext countriesCtx = new 
>> LocalizationContext(countriesBundle, locale);
>> servletCtx.setAttribute("countriesCtx", countriesCtx);
>>
>> ResourceBundle statesBundle =  ResourceBundle.getBundle("states", 
>> locale);
>> LocalizationContext statesCtx = new LocalizationContext(statesBundle, 
>> locale);
>> servletCtx.setAttribute("statesCtx", statesCtx);
>>
>> Then, in your JSP:
>>
>> <fmt:message bundle="${applicationScope.countriesCtx}" 
>> key="message.test">
>> <fmt:message bundle="${applicationScope.statesCtx}" key="message.test">
>
>
> in web.xml this will set up one as the default so you only need to 
> programmatically set up the others, so at least for the most-used 
> bundle you won't have to specify the 'bundle' attribute:
>
>   <context-param>
>     <param-name>
>       javax.servlet.jsp.jstl.fmt.localizationContext
>     </param-name>
>     <param-value>ApplicationResources</param-value>
>   </context-param>
>
>
>


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


Re: [newbie] JSTL using different ResourceBundles

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 10/17/2003 02:17 PM Kris Schneider wrote:
> One approach you could take would be to create your set of alternate
> LocalizationContext instances at application startup and store them in
> application scope:
> 
> ResourceBundle countriesBundle =  ResourceBundle.getBundle("countries", locale);
> LocalizationContext countriesCtx = new LocalizationContext(countriesBundle, locale);
> servletCtx.setAttribute("countriesCtx", countriesCtx);
> 
> ResourceBundle statesBundle =  ResourceBundle.getBundle("states", locale);
> LocalizationContext statesCtx = new LocalizationContext(statesBundle, locale);
> servletCtx.setAttribute("statesCtx", statesCtx);
> 
> Then, in your JSP:
> 
> <fmt:message bundle="${applicationScope.countriesCtx}" key="message.test">
> <fmt:message bundle="${applicationScope.statesCtx}" key="message.test">

in web.xml this will set up one as the default so you only need to 
programmatically set up the others, so at least for the most-used bundle 
you won't have to specify the 'bundle' attribute:

   <context-param>
     <param-name>
       javax.servlet.jsp.jstl.fmt.localizationContext
     </param-name>
     <param-value>ApplicationResources</param-value>
   </context-param>



-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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


Re: [newbie] JSTL using different ResourceBundles

Posted by Kris Schneider <kr...@dotech.com>.
One approach you could take would be to create your set of alternate
LocalizationContext instances at application startup and store them in
application scope:

ResourceBundle countriesBundle =  ResourceBundle.getBundle("countries", locale);
LocalizationContext countriesCtx = new LocalizationContext(countriesBundle, locale);
servletCtx.setAttribute("countriesCtx", countriesCtx);

ResourceBundle statesBundle =  ResourceBundle.getBundle("states", locale);
LocalizationContext statesCtx = new LocalizationContext(statesBundle, locale);
servletCtx.setAttribute("statesCtx", statesCtx);

Then, in your JSP:

<fmt:message bundle="${applicationScope.countriesCtx}" key="message.test">
<fmt:message bundle="${applicationScope.statesCtx}" key="message.test">

Quoting Christian Martin <ch...@joanneum.at>:

> i searched the archive and found a solution to set a LocalizationContext 
> in "back-end" java code.
> therefore i don't have to set the bundle in the JSP.
> <code>
>   ResourceBundle bundle = 
> ResourceBundle.getBundle("ApplicationResources", locale);
>   LocalizationContext ctx = new LocalizationContext(bundle);
>   Config.set(session, Config.FMT_LOCALIZATION_CONTEXT, ctx);
> </code>
> 
> ..following code snippet is not necessary any more
> <code>
>   <fmt:setBundle basename="ApplicationResources" var="ares" />
> </code>
> 
> so far this works fine.
> 
> BUT what do i have to do to set more than one bundle in back-end java code
> 
> i did the following (newbie) trial
> 
> <code>
>   <message-resources parameter="countries" />
>   <message-resources parameter="states" />
> </code>
> .....in struts-config.xml
> 
> then i want to print out messsages in the jsp.
> 
> <code>
>   <fmt:message bundle="${countries}" key="message.test">
>   <fmt:message bundle="${states}" key="message.test">
> </code>
> 
> what is the correct value for parameter bundle?
> 
> but as i expected JSTL can't find the messages. ???message.test??? 
> appears in the browser.
> 
> thanks in advance
> 
> -------------------------------------------------
> please be patient with the newby

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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


Re: [newbie] JSTL using different ResourceBundles

Posted by Christian Martin <ch...@joanneum.at>.
nothing.
are they available in any scope (request, session ...), if i set up the 
variables in struts-config?
i believe i can answer the question for my own. they are not available 
in any scope, because the EL searches in every scope for the variable. 
am i right?
where does <bean:message bundle="test" key="message.test" ... /> get the 
bundle from?
by the way <bean:message .....> doesn't find the bundle either.
following error occurs:

<error>
  javax.servlet.jsp.JspException: Cannot find message resources under key test
</error>
what am i doing wrong i have test.properties on my classpath
and
<code>
 <message-resources parameter="test" />
</code>
in struts-config?

thanks in advance

------------------------------------------------------
student working on a struts projekt during internship





Adam Hardy wrote:

> On 10/17/2003 12:16 PM Christian Martin wrote:
>
>>
>> <code>
>>  <message-resources parameter="countries" />
>>  <message-resources parameter="states" />
>> </code>
>> .....in struts-config.xml
>>
>> then i want to print out messsages in the jsp.
>>
>> <code>
>>  <fmt:message bundle="${countries}" key="message.test">
>>  <fmt:message bundle="${states}" key="message.test">
>> </code>
>>
>> what is the correct value for parameter bundle?
>>
>> but as i expected JSTL can't find the messages. ???message.test??? 
>> appears in the browser.
>
>
> The ${countries} and ${states} won't be available as variables to EL 
> in your JSP just because you have them set up in your struts-config.
>
> If you do:
>
> <c:out value="${countries}" />
>
> what do you get?
>
> Adam
>


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


Re: [newbie] JSTL using different ResourceBundles

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 10/17/2003 12:16 PM Christian Martin wrote:
> 
> <code>
>  <message-resources parameter="countries" />
>  <message-resources parameter="states" />
> </code>
> .....in struts-config.xml
> 
> then i want to print out messsages in the jsp.
> 
> <code>
>  <fmt:message bundle="${countries}" key="message.test">
>  <fmt:message bundle="${states}" key="message.test">
> </code>
> 
> what is the correct value for parameter bundle?
> 
> but as i expected JSTL can't find the messages. ???message.test??? 
> appears in the browser.

The ${countries} and ${states} won't be available as variables to EL in 
your JSP just because you have them set up in your struts-config.

If you do:

<c:out value="${countries}" />

what do you get?

Adam

-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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


[newbie] JSTL using different ResourceBundles

Posted by Christian Martin <ch...@joanneum.at>.
i searched the archive and found a solution to set a LocalizationContext 
in "back-end" java code.
therefore i don't have to set the bundle in the JSP.
<code>
  ResourceBundle bundle = 
ResourceBundle.getBundle("ApplicationResources", locale);
  LocalizationContext ctx = new LocalizationContext(bundle);
  Config.set(session, Config.FMT_LOCALIZATION_CONTEXT, ctx);
</code>

..following code snippet is not necessary any more
<code>
  <fmt:setBundle basename="ApplicationResources" var="ares" />
</code>

so far this works fine.

BUT what do i have to do to set more than one bundle in back-end java code

i did the following (newbie) trial

<code>
  <message-resources parameter="countries" />
  <message-resources parameter="states" />
</code>
.....in struts-config.xml

then i want to print out messsages in the jsp.

<code>
  <fmt:message bundle="${countries}" key="message.test">
  <fmt:message bundle="${states}" key="message.test">
</code>

what is the correct value for parameter bundle?

but as i expected JSTL can't find the messages. ???message.test??? 
appears in the browser.

thanks in advance

-------------------------------------------------
please be patient with the newby


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


Re: Oracle 10g Preview & Linux [OT]

Posted by Duncan Mills <du...@oracle.com>.
The "Web Application [Default]" template uses Struts, and automatically
creates a ViewController project with a config and app resources in it.
You actually have to go out of your way *not* to use Struts with 10g we're
heavily encouraging Struts and Model2 generally for JSP apps.

You can view / customise the technologies used in the default templates
using the Edit button on the New Application Workspace dialog.

Regards

Duncan Mills
----- Original Message ----- 
From: "Martin Gainty" <mg...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Sunday, October 19, 2003 10:27 PM
Subject: Re: Oracle 10g Preview & Linux [OT]


> Christian-
> I have downloaded JDeveloper 10g
> and noticed there is no Application Template for Struts?
> Is this intentional?
> Vielen Dank,
> -Martin
> ----- Original Message ----- 
> From: "Christian Bollmeyer" <ja...@christianbollmeyer.de>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Sunday, October 19, 2003 12:51 PM
> Subject: Oracle 10g Preview & Linux [OT]
>
>
> > Hi all,
> >
> > if anybody else is using the Oracle 10g Preview for Struts
> > development and therefore had to live with the browser
> > command line bug until now (the Preview always forgets the
> > browser command line, and when starting OC4J, clicking
> > on the link given in the 'Embedded OC4J' window doesn't
> > work) here's a simple workaround:
> >
> > Obviously, JDev 10g defaults to using 'netscape' if no
> > other browser command is given. If you're using some
> > other browser, like Mozilla as in my case, the obvious
> > thing is to add a symbolic link named 'netscape'
> > pointing to your Mozilla or whatever startup script.
> > For SuSE, the Mozilla command (also a link) is
> > found in /usr/bin. Go there, su to root and just
> > issue 'ln -s mozilla netscape'. Then everything
> > should work as expected again.
> >
> > -- Chris.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Re: Oracle 10g Preview & Linux [OT]

Posted by Martin Gainty <mg...@hotmail.com>.
Christian-
I have downloaded JDeveloper 10g
and noticed there is no Application Template for Struts?
Is this intentional?
Vielen Dank,
-Martin
----- Original Message ----- 
From: "Christian Bollmeyer" <ja...@christianbollmeyer.de>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Sunday, October 19, 2003 12:51 PM
Subject: Oracle 10g Preview & Linux [OT]


> Hi all,
> 
> if anybody else is using the Oracle 10g Preview for Struts
> development and therefore had to live with the browser
> command line bug until now (the Preview always forgets the
> browser command line, and when starting OC4J, clicking
> on the link given in the 'Embedded OC4J' window doesn't
> work) here's a simple workaround:
> 
> Obviously, JDev 10g defaults to using 'netscape' if no
> other browser command is given. If you're using some
> other browser, like Mozilla as in my case, the obvious
> thing is to add a symbolic link named 'netscape'
> pointing to your Mozilla or whatever startup script.
> For SuSE, the Mozilla command (also a link) is
> found in /usr/bin. Go there, su to root and just
> issue 'ln -s mozilla netscape'. Then everything
> should work as expected again.
> 
> -- Chris.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

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


Oracle 10g Preview & Linux [OT]

Posted by Christian Bollmeyer <ja...@christianbollmeyer.de>.
Hi all,

if anybody else is using the Oracle 10g Preview for Struts
development and therefore had to live with the browser
command line bug until now (the Preview always forgets the
browser command line, and when starting OC4J, clicking
on the link given in the 'Embedded OC4J' window doesn't
work) here's a simple workaround:

Obviously, JDev 10g defaults to using 'netscape' if no
other browser command is given. If you're using some
other browser, like Mozilla as in my case, the obvious
thing is to add a symbolic link named 'netscape'
pointing to your Mozilla or whatever startup script.
For SuSE, the Mozilla command (also a link) is
found in /usr/bin. Go there, su to root and just
issue 'ln -s mozilla netscape'. Then everything
should work as expected again.

-- Chris.


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


Re: i18n - Chinese charactor problem

Posted by ZYD <el...@hotmail.com>.
MySQL version: 4.1.0-alpha-max-nt, 

connection url is:

drivers=org.gjt.mm.mysql.Driver
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=UTF-8

mysql-connector-java-3.0.9-stable-bin.jar is in F:\Program Files\Apache Group\Tomcat 4.1\common\lib

When I write chinese charactor to MySQL, it's not working properly.

----- Original Message ----- 
From: "Adam Hardy" <ah...@cyberspaceroad.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, October 20, 2003 12:09 AM
Subject: Re: i18n - Chinese charactor problem


> What version of mySQL do you have? I believe that complete unicode 
> support is only present in the latest perhaps even beta versions.
> 
> Adam
> 
> On 10/18/2003 07:43 PM ZYD wrote:
> > No, UTF-8 does not work.
> > 
> > ----- Original Message ----- 
> > From: "Adam Hardy" <ah...@cyberspaceroad.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Friday, October 17, 2003 4:49 PM
> > Subject: Re: i18n - Chinese charactor problem
> > 
> > 
> > 
> >>UTF-8
> >>
> >>On 10/16/2003 07:25 PM ZYD wrote:
> >>
> >>>Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.
> >>>
> >>>I have another problem, hope can get some advice from you:
> >>>
> >>>I used the following url to connect to MySQL:
> >>>mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=GB2312
> >>>
> >>>use GB2312 in this string is not a good idea I think. 
> >>>
> >>>Then what should the "characterEncoding" be?
> >>>
> >>>-bruce
> >>>
> >>>----- Original Message ----- 
> >>>From: "Jason Lea" <ja...@kumachan.net.nz>
> >>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>>Sent: Friday, October 17, 2003 11:34 AM
> >>>Subject: Re: i18n - Chinese charactor problem
> >>>
> >>>
> >>>
> >>>
> >>>>If you are using UTF-8 everywhere it should work - I use it for english 
> >>>>& Japanese and it works.
> >>>>You mentioned in another message you had this:
> >>>>
> >>>><filter-class>SetCharacterEncodingFilter</filter-class>
> >>>><init-param>
> >>>><param-name>encoding</param-name>
> >>>><param-value>GB2312</param-value>
> >>>>
> >>>>Are you still using that?  or UTF-8?
> >>>>Everything has to match.
> >>>>
> >>>>
> >>>>ZYD wrote:
> >>>>
> >>>>
> >>>>
> >>>>>Hi Jason,
> >>>>>
> >>>>>Thank you for your response.
> >>>>>
> >>>>>I did exactly the same thing as the article said, but still, not working properly.
> >>>>>
> >>>>>Chinese can be displayed, but not in the text box.  
> >>>>>
> >>>>>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
> >>>>><%@ page contentType="text/html; charset=GBK" %> 
> >>>>>then the Chinese charactors are handled properly.
> >>>>>
> >>>>>Why is that?
> >>>>>
> >>>>>----- Original Message ----- 
> >>>>>From: "Jason Lea" <ja...@kumachan.net.nz>
> >>>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>>>>Sent: Friday, October 17, 2003 5:51 AM
> >>>>>Subject: Re: i18n - Chinese charactor problem
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Here is a link that explains what is needed and a filter to do it...
> >>>>>>
> >>>>>>http://www.anassina.com/struts/i18n/i18n.html
> >>>>>>
> >>>>>>
> >>>>>>Greg Reddin wrote:
> >>>>>>
> >>>>>>  
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>I don't remember the exact code, but a looong time ago we had to write 
> >>>>>>>a Filter that created a request wrapper that properly set the 
> >>>>>>>character encoding on request parameters.  Maybe googling that would 
> >>>>>>>turn up something.
> >>>>>>>
> >>>>>>>Greg
> >>>>>>>
> >>>>>>>ZYD wrote:
> >>>>>>>
> >>>>>>>    
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>>Hi,
> >>>>>>>>I have a problem in getting the Chinese charactors from <html:text>,
> >>>>>>>>The following is my jsp file:
> >>>>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> >>>>>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> >>>>>>>>
> >>>>>>>><html:html>
> >>>>>>>><html:form action="/submit" focus="email">
> >>>>>>>><head></head>
> >>>>>>>><body>
> >>>>>>>><html:text property="email"/>
> >>>>>>>>
> >>>>>>>><html:submit><bean:message key="button.logon"/></html:submit>
> >>>>>>>></body>
> >>>>>>>></html:form>
> >>>>>>>></html:html>
> >>>>>>>>---------------------------------------------
> >>>>>>>>I have two property files, one is for englisn, the other is for 
> >>>>>>>>chinese. Both english and chinese can be displayed properly on the 
> >>>>>>>>page, except in the text box.
> >>>>>>>>
> >>>>>>>>When I input chinese charactors in the text box and submit, I cannot 
> >>>>>>>>get the chinese charactor in the form bean correctly. The chinese 
> >>>>>>>>charactors become some unreadable charactors like ????.
> >>>>>>>>
> >>>>>>>>There are no special process in the getEmail and setEmail method in 
> >>>>>>>>the form bean.
> >>>>>>>>
> >>>>>>>>Does anybody have similar problem? I need your advice.
> >>>>>>>>Any response is appreciated.
> 
> 
> -- 
> --
> struts 1.1 + tomcat 5.0.12 + java 1.4.2
> Linux 2.4.20 RH9
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

Re: i18n - Chinese charactor problem

Posted by ZYD <el...@hotmail.com>.
I use mysql-connector-java-3.0.9-stable-bin.jar, it is in F:\Program Files\Apache Group\Tomcat 4.1\common\lib

MySQL version: 4.1.0-alpha-max-nt, 

connection url is:

drivers=org.gjt.mm.mysql.Driver
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=UTF-8

Not works fine.


----- Original Message ----- 
From: "Jim Theodoridis" <st...@tera.gr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, October 20, 2003 12:27 AM
Subject: Re: i18n - Chinese charactor problem


> Wich jdbc driver for mySQL are U using?
> 
> It works fine to me mysql-connector-java-3.0.8 for Greeks
> 
> 
> ----- Original Message -----
> From: "Adam Hardy" <ah...@cyberspaceroad.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Sunday, October 19, 2003 7:09 PM
> Subject: Re: i18n - Chinese charactor problem
> 
> 
> > What version of mySQL do you have? I believe that complete unicode
> > support is only present in the latest perhaps even beta versions.
> >
> > Adam
> >
> > On 10/18/2003 07:43 PM ZYD wrote:
> > > No, UTF-8 does not work.
> > >
> > > ----- Original Message -----
> > > From: "Adam Hardy" <ah...@cyberspaceroad.com>
> > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > Sent: Friday, October 17, 2003 4:49 PM
> > > Subject: Re: i18n - Chinese charactor problem
> > >
> > >
> > >
> > >>UTF-8
> > >>
> > >>On 10/16/2003 07:25 PM ZYD wrote:
> > >>
> > >>>Now I use UTF-8 everywhere instead of gb2312, this problem is gone.
> Thanks for your help.
> > >>>
> > >>>I have another problem, hope can get some advice from you:
> > >>>
> > >>>I used the following url to connect to MySQL:
> >
> >>>mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUn
> icode=true&characterEncoding=GB2312
> > >>>
> > >>>use GB2312 in this string is not a good idea I think.
> > >>>
> > >>>Then what should the "characterEncoding" be?
> > >>>
> > >>>-bruce
> > >>>
> > >>>----- Original Message -----
> > >>>From: "Jason Lea" <ja...@kumachan.net.nz>
> > >>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > >>>Sent: Friday, October 17, 2003 11:34 AM
> > >>>Subject: Re: i18n - Chinese charactor problem
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>>If you are using UTF-8 everywhere it should work - I use it for
> english
> > >>>>& Japanese and it works.
> > >>>>You mentioned in another message you had this:
> > >>>>
> > >>>><filter-class>SetCharacterEncodingFilter</filter-class>
> > >>>><init-param>
> > >>>><param-name>encoding</param-name>
> > >>>><param-value>GB2312</param-value>
> > >>>>
> > >>>>Are you still using that?  or UTF-8?
> > >>>>Everything has to match.
> > >>>>
> > >>>>
> > >>>>ZYD wrote:
> > >>>>
> > >>>>
> > >>>>
> > >>>>>Hi Jason,
> > >>>>>
> > >>>>>Thank you for your response.
> > >>>>>
> > >>>>>I did exactly the same thing as the article said, but still, not
> working properly.
> > >>>>>
> > >>>>>Chinese can be displayed, but not in the text box.
> > >>>>>
> > >>>>>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
> > >>>>><%@ page contentType="text/html; charset=GBK" %>
> > >>>>>then the Chinese charactors are handled properly.
> > >>>>>
> > >>>>>Why is that?
> > >>>>>
> > >>>>>----- Original Message -----
> > >>>>>From: "Jason Lea" <ja...@kumachan.net.nz>
> > >>>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > >>>>>Sent: Friday, October 17, 2003 5:51 AM
> > >>>>>Subject: Re: i18n - Chinese charactor problem
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>>Here is a link that explains what is needed and a filter to do it...
> > >>>>>>
> > >>>>>>http://www.anassina.com/struts/i18n/i18n.html
> > >>>>>>
> > >>>>>>
> > >>>>>>Greg Reddin wrote:
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>>I don't remember the exact code, but a looong time ago we had to
> write
> > >>>>>>>a Filter that created a request wrapper that properly set the
> > >>>>>>>character encoding on request parameters.  Maybe googling that
> would
> > >>>>>>>turn up something.
> > >>>>>>>
> > >>>>>>>Greg
> > >>>>>>>
> > >>>>>>>ZYD wrote:
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>>Hi,
> > >>>>>>>>I have a problem in getting the Chinese charactors from
> <html:text>,
> > >>>>>>>>The following is my jsp file:
> > >>>>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> > >>>>>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > >>>>>>>>
> > >>>>>>>><html:html>
> > >>>>>>>><html:form action="/submit" focus="email">
> > >>>>>>>><head></head>
> > >>>>>>>><body>
> > >>>>>>>><html:text property="email"/>
> > >>>>>>>>
> > >>>>>>>><html:submit><bean:message key="button.logon"/></html:submit>
> > >>>>>>>></body>
> > >>>>>>>></html:form>
> > >>>>>>>></html:html>
> > >>>>>>>>---------------------------------------------
> > >>>>>>>>I have two property files, one is for englisn, the other is for
> > >>>>>>>>chinese. Both english and chinese can be displayed properly on the
> > >>>>>>>>page, except in the text box.
> > >>>>>>>>
> > >>>>>>>>When I input chinese charactors in the text box and submit, I
> cannot
> > >>>>>>>>get the chinese charactor in the form bean correctly. The chinese
> > >>>>>>>>charactors become some unreadable charactors like ????.
> > >>>>>>>>
> > >>>>>>>>There are no special process in the getEmail and setEmail method
> in
> > >>>>>>>>the form bean.
> > >>>>>>>>
> > >>>>>>>>Does anybody have similar problem? I need your advice.
> > >>>>>>>>Any response is appreciated.
> >
> >
> > --
> > --
> > struts 1.1 + tomcat 5.0.12 + java 1.4.2
> > Linux 2.4.20 RH9
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

Re: i18n - Chinese charactor problem

Posted by Jim Theodoridis <st...@tera.gr>.
Wich jdbc driver for mySQL are U using?

It works fine to me mysql-connector-java-3.0.8 for Greeks


----- Original Message -----
From: "Adam Hardy" <ah...@cyberspaceroad.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Sunday, October 19, 2003 7:09 PM
Subject: Re: i18n - Chinese charactor problem


> What version of mySQL do you have? I believe that complete unicode
> support is only present in the latest perhaps even beta versions.
>
> Adam
>
> On 10/18/2003 07:43 PM ZYD wrote:
> > No, UTF-8 does not work.
> >
> > ----- Original Message -----
> > From: "Adam Hardy" <ah...@cyberspaceroad.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Friday, October 17, 2003 4:49 PM
> > Subject: Re: i18n - Chinese charactor problem
> >
> >
> >
> >>UTF-8
> >>
> >>On 10/16/2003 07:25 PM ZYD wrote:
> >>
> >>>Now I use UTF-8 everywhere instead of gb2312, this problem is gone.
Thanks for your help.
> >>>
> >>>I have another problem, hope can get some advice from you:
> >>>
> >>>I used the following url to connect to MySQL:
>
>>>mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUn
icode=true&characterEncoding=GB2312
> >>>
> >>>use GB2312 in this string is not a good idea I think.
> >>>
> >>>Then what should the "characterEncoding" be?
> >>>
> >>>-bruce
> >>>
> >>>----- Original Message -----
> >>>From: "Jason Lea" <ja...@kumachan.net.nz>
> >>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>>Sent: Friday, October 17, 2003 11:34 AM
> >>>Subject: Re: i18n - Chinese charactor problem
> >>>
> >>>
> >>>
> >>>
> >>>>If you are using UTF-8 everywhere it should work - I use it for
english
> >>>>& Japanese and it works.
> >>>>You mentioned in another message you had this:
> >>>>
> >>>><filter-class>SetCharacterEncodingFilter</filter-class>
> >>>><init-param>
> >>>><param-name>encoding</param-name>
> >>>><param-value>GB2312</param-value>
> >>>>
> >>>>Are you still using that?  or UTF-8?
> >>>>Everything has to match.
> >>>>
> >>>>
> >>>>ZYD wrote:
> >>>>
> >>>>
> >>>>
> >>>>>Hi Jason,
> >>>>>
> >>>>>Thank you for your response.
> >>>>>
> >>>>>I did exactly the same thing as the article said, but still, not
working properly.
> >>>>>
> >>>>>Chinese can be displayed, but not in the text box.
> >>>>>
> >>>>>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
> >>>>><%@ page contentType="text/html; charset=GBK" %>
> >>>>>then the Chinese charactors are handled properly.
> >>>>>
> >>>>>Why is that?
> >>>>>
> >>>>>----- Original Message -----
> >>>>>From: "Jason Lea" <ja...@kumachan.net.nz>
> >>>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>>>>Sent: Friday, October 17, 2003 5:51 AM
> >>>>>Subject: Re: i18n - Chinese charactor problem
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Here is a link that explains what is needed and a filter to do it...
> >>>>>>
> >>>>>>http://www.anassina.com/struts/i18n/i18n.html
> >>>>>>
> >>>>>>
> >>>>>>Greg Reddin wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>I don't remember the exact code, but a looong time ago we had to
write
> >>>>>>>a Filter that created a request wrapper that properly set the
> >>>>>>>character encoding on request parameters.  Maybe googling that
would
> >>>>>>>turn up something.
> >>>>>>>
> >>>>>>>Greg
> >>>>>>>
> >>>>>>>ZYD wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>>Hi,
> >>>>>>>>I have a problem in getting the Chinese charactors from
<html:text>,
> >>>>>>>>The following is my jsp file:
> >>>>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> >>>>>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> >>>>>>>>
> >>>>>>>><html:html>
> >>>>>>>><html:form action="/submit" focus="email">
> >>>>>>>><head></head>
> >>>>>>>><body>
> >>>>>>>><html:text property="email"/>
> >>>>>>>>
> >>>>>>>><html:submit><bean:message key="button.logon"/></html:submit>
> >>>>>>>></body>
> >>>>>>>></html:form>
> >>>>>>>></html:html>
> >>>>>>>>---------------------------------------------
> >>>>>>>>I have two property files, one is for englisn, the other is for
> >>>>>>>>chinese. Both english and chinese can be displayed properly on the
> >>>>>>>>page, except in the text box.
> >>>>>>>>
> >>>>>>>>When I input chinese charactors in the text box and submit, I
cannot
> >>>>>>>>get the chinese charactor in the form bean correctly. The chinese
> >>>>>>>>charactors become some unreadable charactors like ????.
> >>>>>>>>
> >>>>>>>>There are no special process in the getEmail and setEmail method
in
> >>>>>>>>the form bean.
> >>>>>>>>
> >>>>>>>>Does anybody have similar problem? I need your advice.
> >>>>>>>>Any response is appreciated.
>
>
> --
> --
> struts 1.1 + tomcat 5.0.12 + java 1.4.2
> Linux 2.4.20 RH9
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



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


Re: i18n - Chinese charactor problem

Posted by Adam Hardy <ah...@cyberspaceroad.com>.

Hi Zyd,
I am using the same version as you and that code works for me. I just 
ran it. Are you trying it in a new database? Perhaps in an old database 
in an old version it won't work.

BTW if this doesn't resolve it, perhaps you should email me off-list or 
go the mysql@lists.mysql.com since it's completely off-topic for struts now.

Adam

On 10/19/2003 04:01 PM ZYD wrote:
> It's said version4.1 supports unicode, my MySQL version: 4.1.0-alpha-max-nt,  but I cannot execute the following:
> 
> CREATE TABLE unicodetable ( myrow VARCHAR(200) )
>    CHARACTER SET UTF8;
> 
> ERROR 1115: Unknown character set: 'UTF8'
> 
> connection url is:
> drivers=org.gjt.mm.mysql.Driver
> mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=UTF-8
> 
> mysql-connector-java-3.0.9-stable-bin.jar is in F:\Program Files\Apache Group\Tomcat 4.1\common\lib
> 
> When I write chinese charactor to MySQL, it's not working properly.
> 
> 
> ----- Original Message ----- 
> From: "Adam Hardy" <ah...@cyberspaceroad.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Monday, October 20, 2003 12:09 AM
> Subject: Re: i18n - Chinese charactor problem
> 
> 
> 
>>What version of mySQL do you have? I believe that complete unicode 
>>support is only present in the latest perhaps even beta versions.
>>
>>Adam
>>
>>On 10/18/2003 07:43 PM ZYD wrote:
>>
>>>No, UTF-8 does not work.
>>>
>>>----- Original Message ----- 
>>>From: "Adam Hardy" <ah...@cyberspaceroad.com>
>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>Sent: Friday, October 17, 2003 4:49 PM
>>>Subject: Re: i18n - Chinese charactor problem
>>>
>>>
>>>
>>>
>>>>UTF-8
>>>>
>>>>On 10/16/2003 07:25 PM ZYD wrote:
>>>>
>>>>
>>>>>Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.
>>>>>
>>>>>I have another problem, hope can get some advice from you:
>>>>>
>>>>>I used the following url to connect to MySQL:
>>>>>mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=GB2312
>>>>>
>>>>>use GB2312 in this string is not a good idea I think. 
>>>>>
>>>>>Then what should the "characterEncoding" be?
>>>>>
>>>>>-bruce
>>>>>
>>>>>----- Original Message ----- 
>>>>>From: "Jason Lea" <ja...@kumachan.net.nz>
>>>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>>>Sent: Friday, October 17, 2003 11:34 AM
>>>>>Subject: Re: i18n - Chinese charactor problem
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>If you are using UTF-8 everywhere it should work - I use it for english 
>>>>>>& Japanese and it works.
>>>>>>You mentioned in another message you had this:
>>>>>>
>>>>>><filter-class>SetCharacterEncodingFilter</filter-class>
>>>>>><init-param>
>>>>>><param-name>encoding</param-name>
>>>>>><param-value>GB2312</param-value>
>>>>>>
>>>>>>Are you still using that?  or UTF-8?
>>>>>>Everything has to match.
>>>>>>
>>>>>>
>>>>>>ZYD wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hi Jason,
>>>>>>>
>>>>>>>Thank you for your response.
>>>>>>>
>>>>>>>I did exactly the same thing as the article said, but still, not working properly.
>>>>>>>
>>>>>>>Chinese can be displayed, but not in the text box.  
>>>>>>>
>>>>>>>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
>>>>>>><%@ page contentType="text/html; charset=GBK" %> 
>>>>>>>then the Chinese charactors are handled properly.
>>>>>>>
>>>>>>>Why is that?
>>>>>>>
>>>>>>>----- Original Message ----- 
>>>>>>>From: "Jason Lea" <ja...@kumachan.net.nz>
>>>>>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>>>>>Sent: Friday, October 17, 2003 5:51 AM
>>>>>>>Subject: Re: i18n - Chinese charactor problem
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Here is a link that explains what is needed and a filter to do it...
>>>>>>>>
>>>>>>>>http://www.anassina.com/struts/i18n/i18n.html
>>>>>>>>
>>>>>>>>
>>>>>>>>Greg Reddin wrote:
>>>>>>>>
>>>>>>>> 
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>I don't remember the exact code, but a looong time ago we had to write 
>>>>>>>>>a Filter that created a request wrapper that properly set the 
>>>>>>>>>character encoding on request parameters.  Maybe googling that would 
>>>>>>>>>turn up something.
>>>>>>>>>
>>>>>>>>>Greg
>>>>>>>>>
>>>>>>>>>ZYD wrote:
>>>>>>>>>
>>>>>>>>>   
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>Hi,
>>>>>>>>>>I have a problem in getting the Chinese charactors from <html:text>,
>>>>>>>>>>The following is my jsp file:
>>>>>>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
>>>>>>>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>>>>>>>>>>
>>>>>>>>>><html:html>
>>>>>>>>>><html:form action="/submit" focus="email">
>>>>>>>>>><head></head>
>>>>>>>>>><body>
>>>>>>>>>><html:text property="email"/>
>>>>>>>>>>
>>>>>>>>>><html:submit><bean:message key="button.logon"/></html:submit>
>>>>>>>>>></body>
>>>>>>>>>></html:form>
>>>>>>>>>></html:html>
>>>>>>>>>>---------------------------------------------
>>>>>>>>>>I have two property files, one is for englisn, the other is for 
>>>>>>>>>>chinese. Both english and chinese can be displayed properly on the 
>>>>>>>>>>page, except in the text box.
>>>>>>>>>>
>>>>>>>>>>When I input chinese charactors in the text box and submit, I cannot 
>>>>>>>>>>get the chinese charactor in the form bean correctly. The chinese 
>>>>>>>>>>charactors become some unreadable charactors like ????.
>>>>>>>>>>
>>>>>>>>>>There are no special process in the getEmail and setEmail method in 
>>>>>>>>>>the form bean.
>>>>>>>>>>
>>>>>>>>>>Does anybody have similar problem? I need your advice.
>>>>>>>>>>Any response is appreciated.


-- 
--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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


Re: i18n - Chinese charactor problem

Posted by ZYD <el...@hotmail.com>.
It's said version4.1 supports unicode, my MySQL version: 4.1.0-alpha-max-nt,  but I cannot execute the following:

CREATE TABLE unicodetable ( myrow VARCHAR(200) )
   CHARACTER SET UTF8;

ERROR 1115: Unknown character set: 'UTF8'

connection url is:
drivers=org.gjt.mm.mysql.Driver
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=UTF-8

mysql-connector-java-3.0.9-stable-bin.jar is in F:\Program Files\Apache Group\Tomcat 4.1\common\lib

When I write chinese charactor to MySQL, it's not working properly.


----- Original Message ----- 
From: "Adam Hardy" <ah...@cyberspaceroad.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, October 20, 2003 12:09 AM
Subject: Re: i18n - Chinese charactor problem


> What version of mySQL do you have? I believe that complete unicode 
> support is only present in the latest perhaps even beta versions.
> 
> Adam
> 
> On 10/18/2003 07:43 PM ZYD wrote:
> > No, UTF-8 does not work.
> > 
> > ----- Original Message ----- 
> > From: "Adam Hardy" <ah...@cyberspaceroad.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Friday, October 17, 2003 4:49 PM
> > Subject: Re: i18n - Chinese charactor problem
> > 
> > 
> > 
> >>UTF-8
> >>
> >>On 10/16/2003 07:25 PM ZYD wrote:
> >>
> >>>Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.
> >>>
> >>>I have another problem, hope can get some advice from you:
> >>>
> >>>I used the following url to connect to MySQL:
> >>>mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=GB2312
> >>>
> >>>use GB2312 in this string is not a good idea I think. 
> >>>
> >>>Then what should the "characterEncoding" be?
> >>>
> >>>-bruce
> >>>
> >>>----- Original Message ----- 
> >>>From: "Jason Lea" <ja...@kumachan.net.nz>
> >>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>>Sent: Friday, October 17, 2003 11:34 AM
> >>>Subject: Re: i18n - Chinese charactor problem
> >>>
> >>>
> >>>
> >>>
> >>>>If you are using UTF-8 everywhere it should work - I use it for english 
> >>>>& Japanese and it works.
> >>>>You mentioned in another message you had this:
> >>>>
> >>>><filter-class>SetCharacterEncodingFilter</filter-class>
> >>>><init-param>
> >>>><param-name>encoding</param-name>
> >>>><param-value>GB2312</param-value>
> >>>>
> >>>>Are you still using that?  or UTF-8?
> >>>>Everything has to match.
> >>>>
> >>>>
> >>>>ZYD wrote:
> >>>>
> >>>>
> >>>>
> >>>>>Hi Jason,
> >>>>>
> >>>>>Thank you for your response.
> >>>>>
> >>>>>I did exactly the same thing as the article said, but still, not working properly.
> >>>>>
> >>>>>Chinese can be displayed, but not in the text box.  
> >>>>>
> >>>>>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
> >>>>><%@ page contentType="text/html; charset=GBK" %> 
> >>>>>then the Chinese charactors are handled properly.
> >>>>>
> >>>>>Why is that?
> >>>>>
> >>>>>----- Original Message ----- 
> >>>>>From: "Jason Lea" <ja...@kumachan.net.nz>
> >>>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>>>>Sent: Friday, October 17, 2003 5:51 AM
> >>>>>Subject: Re: i18n - Chinese charactor problem
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Here is a link that explains what is needed and a filter to do it...
> >>>>>>
> >>>>>>http://www.anassina.com/struts/i18n/i18n.html
> >>>>>>
> >>>>>>
> >>>>>>Greg Reddin wrote:
> >>>>>>
> >>>>>>  
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>I don't remember the exact code, but a looong time ago we had to write 
> >>>>>>>a Filter that created a request wrapper that properly set the 
> >>>>>>>character encoding on request parameters.  Maybe googling that would 
> >>>>>>>turn up something.
> >>>>>>>
> >>>>>>>Greg
> >>>>>>>
> >>>>>>>ZYD wrote:
> >>>>>>>
> >>>>>>>    
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>>Hi,
> >>>>>>>>I have a problem in getting the Chinese charactors from <html:text>,
> >>>>>>>>The following is my jsp file:
> >>>>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> >>>>>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> >>>>>>>>
> >>>>>>>><html:html>
> >>>>>>>><html:form action="/submit" focus="email">
> >>>>>>>><head></head>
> >>>>>>>><body>
> >>>>>>>><html:text property="email"/>
> >>>>>>>>
> >>>>>>>><html:submit><bean:message key="button.logon"/></html:submit>
> >>>>>>>></body>
> >>>>>>>></html:form>
> >>>>>>>></html:html>
> >>>>>>>>---------------------------------------------
> >>>>>>>>I have two property files, one is for englisn, the other is for 
> >>>>>>>>chinese. Both english and chinese can be displayed properly on the 
> >>>>>>>>page, except in the text box.
> >>>>>>>>
> >>>>>>>>When I input chinese charactors in the text box and submit, I cannot 
> >>>>>>>>get the chinese charactor in the form bean correctly. The chinese 
> >>>>>>>>charactors become some unreadable charactors like ????.
> >>>>>>>>
> >>>>>>>>There are no special process in the getEmail and setEmail method in 
> >>>>>>>>the form bean.
> >>>>>>>>
> >>>>>>>>Does anybody have similar problem? I need your advice.
> >>>>>>>>Any response is appreciated.
> 
> 
> -- 
> --
> struts 1.1 + tomcat 5.0.12 + java 1.4.2
> Linux 2.4.20 RH9
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

Re: i18n - Chinese charactor problem

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
What version of mySQL do you have? I believe that complete unicode 
support is only present in the latest perhaps even beta versions.

Adam

On 10/18/2003 07:43 PM ZYD wrote:
> No, UTF-8 does not work.
> 
> ----- Original Message ----- 
> From: "Adam Hardy" <ah...@cyberspaceroad.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Friday, October 17, 2003 4:49 PM
> Subject: Re: i18n - Chinese charactor problem
> 
> 
> 
>>UTF-8
>>
>>On 10/16/2003 07:25 PM ZYD wrote:
>>
>>>Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.
>>>
>>>I have another problem, hope can get some advice from you:
>>>
>>>I used the following url to connect to MySQL:
>>>mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=GB2312
>>>
>>>use GB2312 in this string is not a good idea I think. 
>>>
>>>Then what should the "characterEncoding" be?
>>>
>>>-bruce
>>>
>>>----- Original Message ----- 
>>>From: "Jason Lea" <ja...@kumachan.net.nz>
>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>Sent: Friday, October 17, 2003 11:34 AM
>>>Subject: Re: i18n - Chinese charactor problem
>>>
>>>
>>>
>>>
>>>>If you are using UTF-8 everywhere it should work - I use it for english 
>>>>& Japanese and it works.
>>>>You mentioned in another message you had this:
>>>>
>>>><filter-class>SetCharacterEncodingFilter</filter-class>
>>>><init-param>
>>>><param-name>encoding</param-name>
>>>><param-value>GB2312</param-value>
>>>>
>>>>Are you still using that?  or UTF-8?
>>>>Everything has to match.
>>>>
>>>>
>>>>ZYD wrote:
>>>>
>>>>
>>>>
>>>>>Hi Jason,
>>>>>
>>>>>Thank you for your response.
>>>>>
>>>>>I did exactly the same thing as the article said, but still, not working properly.
>>>>>
>>>>>Chinese can be displayed, but not in the text box.  
>>>>>
>>>>>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
>>>>><%@ page contentType="text/html; charset=GBK" %> 
>>>>>then the Chinese charactors are handled properly.
>>>>>
>>>>>Why is that?
>>>>>
>>>>>----- Original Message ----- 
>>>>>From: "Jason Lea" <ja...@kumachan.net.nz>
>>>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>>>Sent: Friday, October 17, 2003 5:51 AM
>>>>>Subject: Re: i18n - Chinese charactor problem
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Here is a link that explains what is needed and a filter to do it...
>>>>>>
>>>>>>http://www.anassina.com/struts/i18n/i18n.html
>>>>>>
>>>>>>
>>>>>>Greg Reddin wrote:
>>>>>>
>>>>>>  
>>>>>>
>>>>>>
>>>>>>
>>>>>>>I don't remember the exact code, but a looong time ago we had to write 
>>>>>>>a Filter that created a request wrapper that properly set the 
>>>>>>>character encoding on request parameters.  Maybe googling that would 
>>>>>>>turn up something.
>>>>>>>
>>>>>>>Greg
>>>>>>>
>>>>>>>ZYD wrote:
>>>>>>>
>>>>>>>    
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Hi,
>>>>>>>>I have a problem in getting the Chinese charactors from <html:text>,
>>>>>>>>The following is my jsp file:
>>>>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
>>>>>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>>>>>>>>
>>>>>>>><html:html>
>>>>>>>><html:form action="/submit" focus="email">
>>>>>>>><head></head>
>>>>>>>><body>
>>>>>>>><html:text property="email"/>
>>>>>>>>
>>>>>>>><html:submit><bean:message key="button.logon"/></html:submit>
>>>>>>>></body>
>>>>>>>></html:form>
>>>>>>>></html:html>
>>>>>>>>---------------------------------------------
>>>>>>>>I have two property files, one is for englisn, the other is for 
>>>>>>>>chinese. Both english and chinese can be displayed properly on the 
>>>>>>>>page, except in the text box.
>>>>>>>>
>>>>>>>>When I input chinese charactors in the text box and submit, I cannot 
>>>>>>>>get the chinese charactor in the form bean correctly. The chinese 
>>>>>>>>charactors become some unreadable charactors like ????.
>>>>>>>>
>>>>>>>>There are no special process in the getEmail and setEmail method in 
>>>>>>>>the form bean.
>>>>>>>>
>>>>>>>>Does anybody have similar problem? I need your advice.
>>>>>>>>Any response is appreciated.


-- 
--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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


Re: i18n - Chinese charactor problem

Posted by ZYD <el...@hotmail.com>.
No, UTF-8 does not work.

----- Original Message ----- 
From: "Adam Hardy" <ah...@cyberspaceroad.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 17, 2003 4:49 PM
Subject: Re: i18n - Chinese charactor problem


> UTF-8
> 
> On 10/16/2003 07:25 PM ZYD wrote:
> > Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.
> > 
> > I have another problem, hope can get some advice from you:
> > 
> > I used the following url to connect to MySQL:
> > mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=GB2312
> > 
> > use GB2312 in this string is not a good idea I think. 
> > 
> > Then what should the "characterEncoding" be?
> > 
> > -bruce
> > 
> > ----- Original Message ----- 
> > From: "Jason Lea" <ja...@kumachan.net.nz>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Friday, October 17, 2003 11:34 AM
> > Subject: Re: i18n - Chinese charactor problem
> > 
> > 
> > 
> >>If you are using UTF-8 everywhere it should work - I use it for english 
> >>& Japanese and it works.
> >>You mentioned in another message you had this:
> >>
> >><filter-class>SetCharacterEncodingFilter</filter-class>
> >><init-param>
> >><param-name>encoding</param-name>
> >><param-value>GB2312</param-value>
> >>
> >>Are you still using that?  or UTF-8?
> >>Everything has to match.
> >>
> >>
> >>ZYD wrote:
> >>
> >>
> >>>Hi Jason,
> >>>
> >>>Thank you for your response.
> >>>
> >>>I did exactly the same thing as the article said, but still, not working properly.
> >>>
> >>>Chinese can be displayed, but not in the text box.  
> >>>
> >>>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
> >>><%@ page contentType="text/html; charset=GBK" %> 
> >>>then the Chinese charactors are handled properly.
> >>>
> >>>Why is that?
> >>>
> >>>----- Original Message ----- 
> >>>From: "Jason Lea" <ja...@kumachan.net.nz>
> >>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >>>Sent: Friday, October 17, 2003 5:51 AM
> >>>Subject: Re: i18n - Chinese charactor problem
> >>>
> >>>
> >>> 
> >>>
> >>>
> >>>>Here is a link that explains what is needed and a filter to do it...
> >>>>
> >>>>http://www.anassina.com/struts/i18n/i18n.html
> >>>>
> >>>>
> >>>>Greg Reddin wrote:
> >>>>
> >>>>   
> >>>>
> >>>>
> >>>>>I don't remember the exact code, but a looong time ago we had to write 
> >>>>>a Filter that created a request wrapper that properly set the 
> >>>>>character encoding on request parameters.  Maybe googling that would 
> >>>>>turn up something.
> >>>>>
> >>>>>Greg
> >>>>>
> >>>>>ZYD wrote:
> >>>>>
> >>>>>     
> >>>>>
> >>>>>
> >>>>>>Hi,
> >>>>>>I have a problem in getting the Chinese charactors from <html:text>,
> >>>>>>The following is my jsp file:
> >>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> >>>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> >>>>>>
> >>>>>><html:html>
> >>>>>><html:form action="/submit" focus="email">
> >>>>>><head></head>
> >>>>>><body>
> >>>>>> <html:text property="email"/>
> >>>>>>
> >>>>>> <html:submit><bean:message key="button.logon"/></html:submit>
> >>>>>></body>
> >>>>>></html:form>
> >>>>>></html:html>
> >>>>>>---------------------------------------------
> >>>>>>I have two property files, one is for englisn, the other is for 
> >>>>>>chinese. Both english and chinese can be displayed properly on the 
> >>>>>>page, except in the text box.
> >>>>>>
> >>>>>>When I input chinese charactors in the text box and submit, I cannot 
> >>>>>>get the chinese charactor in the form bean correctly. The chinese 
> >>>>>>charactors become some unreadable charactors like ????.
> >>>>>>
> >>>>>>There are no special process in the getEmail and setEmail method in 
> >>>>>>the form bean.
> >>>>>>
> >>>>>>Does anybody have similar problem? I need your advice.
> >>>>>>Any response is appreciated.
> 
> 
> -- 
> struts 1.1 + tomcat 5.0.12 + java 1.4.2
> Linux 2.4.20 RH9
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

Re: i18n - Chinese charactor problem

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
UTF-8

On 10/16/2003 07:25 PM ZYD wrote:
> Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.
> 
> I have another problem, hope can get some advice from you:
> 
> I used the following url to connect to MySQL:
> mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=GB2312
> 
> use GB2312 in this string is not a good idea I think. 
> 
> Then what should the "characterEncoding" be?
> 
> -bruce
> 
> ----- Original Message ----- 
> From: "Jason Lea" <ja...@kumachan.net.nz>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Friday, October 17, 2003 11:34 AM
> Subject: Re: i18n - Chinese charactor problem
> 
> 
> 
>>If you are using UTF-8 everywhere it should work - I use it for english 
>>& Japanese and it works.
>>You mentioned in another message you had this:
>>
>><filter-class>SetCharacterEncodingFilter</filter-class>
>><init-param>
>><param-name>encoding</param-name>
>><param-value>GB2312</param-value>
>>
>>Are you still using that?  or UTF-8?
>>Everything has to match.
>>
>>
>>ZYD wrote:
>>
>>
>>>Hi Jason,
>>>
>>>Thank you for your response.
>>>
>>>I did exactly the same thing as the article said, but still, not working properly.
>>>
>>>Chinese can be displayed, but not in the text box.  
>>>
>>>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
>>><%@ page contentType="text/html; charset=GBK" %> 
>>>then the Chinese charactors are handled properly.
>>>
>>>Why is that?
>>>
>>>----- Original Message ----- 
>>>From: "Jason Lea" <ja...@kumachan.net.nz>
>>>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>>>Sent: Friday, October 17, 2003 5:51 AM
>>>Subject: Re: i18n - Chinese charactor problem
>>>
>>>
>>> 
>>>
>>>
>>>>Here is a link that explains what is needed and a filter to do it...
>>>>
>>>>http://www.anassina.com/struts/i18n/i18n.html
>>>>
>>>>
>>>>Greg Reddin wrote:
>>>>
>>>>   
>>>>
>>>>
>>>>>I don't remember the exact code, but a looong time ago we had to write 
>>>>>a Filter that created a request wrapper that properly set the 
>>>>>character encoding on request parameters.  Maybe googling that would 
>>>>>turn up something.
>>>>>
>>>>>Greg
>>>>>
>>>>>ZYD wrote:
>>>>>
>>>>>     
>>>>>
>>>>>
>>>>>>Hi,
>>>>>>I have a problem in getting the Chinese charactors from <html:text>,
>>>>>>The following is my jsp file:
>>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
>>>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>>>>>>
>>>>>><html:html>
>>>>>><html:form action="/submit" focus="email">
>>>>>><head></head>
>>>>>><body>
>>>>>> <html:text property="email"/>
>>>>>>
>>>>>> <html:submit><bean:message key="button.logon"/></html:submit>
>>>>>></body>
>>>>>></html:form>
>>>>>></html:html>
>>>>>>---------------------------------------------
>>>>>>I have two property files, one is for englisn, the other is for 
>>>>>>chinese. Both english and chinese can be displayed properly on the 
>>>>>>page, except in the text box.
>>>>>>
>>>>>>When I input chinese charactors in the text box and submit, I cannot 
>>>>>>get the chinese charactor in the form bean correctly. The chinese 
>>>>>>charactors become some unreadable charactors like ????.
>>>>>>
>>>>>>There are no special process in the getEmail and setEmail method in 
>>>>>>the form bean.
>>>>>>
>>>>>>Does anybody have similar problem? I need your advice.
>>>>>>Any response is appreciated.


-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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


Re: i18n - Chinese charactor problem

Posted by ZYD <el...@hotmail.com>.
Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.

I have another problem, hope can get some advice from you:

I used the following url to connect to MySQL:
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=root&password=&useUnicode=true&characterEncoding=GB2312

use GB2312 in this string is not a good idea I think. 

Then what should the "characterEncoding" be?

-bruce

----- Original Message ----- 
From: "Jason Lea" <ja...@kumachan.net.nz>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 17, 2003 11:34 AM
Subject: Re: i18n - Chinese charactor problem


> If you are using UTF-8 everywhere it should work - I use it for english 
> & Japanese and it works.
> You mentioned in another message you had this:
> 
> <filter-class>SetCharacterEncodingFilter</filter-class>
> <init-param>
> <param-name>encoding</param-name>
> <param-value>GB2312</param-value>
> 
> Are you still using that?  or UTF-8?
> Everything has to match.
> 
> 
> ZYD wrote:
> 
> >Hi Jason,
> >
> >Thank you for your response.
> >
> >I did exactly the same thing as the article said, but still, not working properly.
> >
> >Chinese can be displayed, but not in the text box.  
> >
> >If I change <%@ page contentType="text/html; charset=UTF-8" %> to
> ><%@ page contentType="text/html; charset=GBK" %> 
> >then the Chinese charactors are handled properly.
> >
> >Why is that?
> >
> >----- Original Message ----- 
> >From: "Jason Lea" <ja...@kumachan.net.nz>
> >To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >Sent: Friday, October 17, 2003 5:51 AM
> >Subject: Re: i18n - Chinese charactor problem
> >
> >
> >  
> >
> >>Here is a link that explains what is needed and a filter to do it...
> >>
> >>http://www.anassina.com/struts/i18n/i18n.html
> >>
> >>
> >>Greg Reddin wrote:
> >>
> >>    
> >>
> >>>I don't remember the exact code, but a looong time ago we had to write 
> >>>a Filter that created a request wrapper that properly set the 
> >>>character encoding on request parameters.  Maybe googling that would 
> >>>turn up something.
> >>>
> >>>Greg
> >>>
> >>>ZYD wrote:
> >>>
> >>>      
> >>>
> >>>>Hi,
> >>>>I have a problem in getting the Chinese charactors from <html:text>,
> >>>>The following is my jsp file:
> >>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> >>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> >>>>
> >>>><html:html>
> >>>><html:form action="/submit" focus="email">
> >>>> <head></head>
> >>>> <body>
> >>>>  <html:text property="email"/>
> >>>>
> >>>>  <html:submit><bean:message key="button.logon"/></html:submit>
> >>>> </body>
> >>>></html:form>
> >>>></html:html>
> >>>>---------------------------------------------
> >>>>I have two property files, one is for englisn, the other is for 
> >>>>chinese. Both english and chinese can be displayed properly on the 
> >>>>page, except in the text box.
> >>>>
> >>>>When I input chinese charactors in the text box and submit, I cannot 
> >>>>get the chinese charactor in the form bean correctly. The chinese 
> >>>>charactors become some unreadable charactors like ????.
> >>>>
> >>>>There are no special process in the getEmail and setEmail method in 
> >>>>the form bean.
> >>>>
> >>>>Does anybody have similar problem? I need your advice.
> >>>>Any response is appreciated.
> >>>>
> >>>>--bruce
> >>>>        
> >>>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>>
> >>>
> >>>      
> >>>
> >>-- 
> >>Jason Lea
> >>
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >>    
> >>
> 
> 
> -- 
> Jason Lea
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

Re: i18n - Chinese charactor problem

Posted by Jason Lea <ja...@kumachan.net.nz>.
If you are using UTF-8 everywhere it should work - I use it for english 
& Japanese and it works.
You mentioned in another message you had this:

<filter-class>SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GB2312</param-value>

Are you still using that?  or UTF-8?
Everything has to match.


ZYD wrote:

>Hi Jason,
>
>Thank you for your response.
>
>I did exactly the same thing as the article said, but still, not working properly.
>
>Chinese can be displayed, but not in the text box.  
>
>If I change <%@ page contentType="text/html; charset=UTF-8" %> to
><%@ page contentType="text/html; charset=GBK" %> 
>then the Chinese charactors are handled properly.
>
>Why is that?
>
>----- Original Message ----- 
>From: "Jason Lea" <ja...@kumachan.net.nz>
>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>Sent: Friday, October 17, 2003 5:51 AM
>Subject: Re: i18n - Chinese charactor problem
>
>
>  
>
>>Here is a link that explains what is needed and a filter to do it...
>>
>>http://www.anassina.com/struts/i18n/i18n.html
>>
>>
>>Greg Reddin wrote:
>>
>>    
>>
>>>I don't remember the exact code, but a looong time ago we had to write 
>>>a Filter that created a request wrapper that properly set the 
>>>character encoding on request parameters.  Maybe googling that would 
>>>turn up something.
>>>
>>>Greg
>>>
>>>ZYD wrote:
>>>
>>>      
>>>
>>>>Hi,
>>>>I have a problem in getting the Chinese charactors from <html:text>,
>>>>The following is my jsp file:
>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
>>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>>>>
>>>><html:html>
>>>><html:form action="/submit" focus="email">
>>>> <head></head>
>>>> <body>
>>>>  <html:text property="email"/>
>>>>
>>>>  <html:submit><bean:message key="button.logon"/></html:submit>
>>>> </body>
>>>></html:form>
>>>></html:html>
>>>>---------------------------------------------
>>>>I have two property files, one is for englisn, the other is for 
>>>>chinese. Both english and chinese can be displayed properly on the 
>>>>page, except in the text box.
>>>>
>>>>When I input chinese charactors in the text box and submit, I cannot 
>>>>get the chinese charactor in the form bean correctly. The chinese 
>>>>charactors become some unreadable charactors like ????.
>>>>
>>>>There are no special process in the getEmail and setEmail method in 
>>>>the form bean.
>>>>
>>>>Does anybody have similar problem? I need your advice.
>>>>Any response is appreciated.
>>>>
>>>>--bruce
>>>>        
>>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>
>>>      
>>>
>>-- 
>>Jason Lea
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>    
>>


-- 
Jason Lea




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


Re: i18n - Chinese charactor problem

Posted by ZYD <el...@hotmail.com>.
Hi Jason,

Thank you for your response.

I did exactly the same thing as the article said, but still, not working properly.

Chinese can be displayed, but not in the text box.  

If I change <%@ page contentType="text/html; charset=UTF-8" %> to
<%@ page contentType="text/html; charset=GBK" %> 
then the Chinese charactors are handled properly.

Why is that?

----- Original Message ----- 
From: "Jason Lea" <ja...@kumachan.net.nz>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 17, 2003 5:51 AM
Subject: Re: i18n - Chinese charactor problem


> Here is a link that explains what is needed and a filter to do it...
> 
> http://www.anassina.com/struts/i18n/i18n.html
> 
> 
> Greg Reddin wrote:
> 
> > I don't remember the exact code, but a looong time ago we had to write 
> > a Filter that created a request wrapper that properly set the 
> > character encoding on request parameters.  Maybe googling that would 
> > turn up something.
> >
> > Greg
> >
> > ZYD wrote:
> >
> >> Hi,
> >> I have a problem in getting the Chinese charactors from <html:text>,
> >> The following is my jsp file:
> >> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> >> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> >>
> >> <html:html>
> >> <html:form action="/submit" focus="email">
> >>  <head></head>
> >>  <body>
> >>   <html:text property="email"/>
> >>
> >>   <html:submit><bean:message key="button.logon"/></html:submit>
> >>  </body>
> >> </html:form>
> >> </html:html>
> >> ---------------------------------------------
> >> I have two property files, one is for englisn, the other is for 
> >> chinese. Both english and chinese can be displayed properly on the 
> >> page, except in the text box.
> >>
> >> When I input chinese charactors in the text box and submit, I cannot 
> >> get the chinese charactor in the form bean correctly. The chinese 
> >> charactors become some unreadable charactors like ????.
> >>
> >> There are no special process in the getEmail and setEmail method in 
> >> the form bean.
> >>
> >> Does anybody have similar problem? I need your advice.
> >> Any response is appreciated.
> >>
> >> --bruce
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> 
> 
> -- 
> Jason Lea
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

Re: i18n - Chinese charactor problem

Posted by Jason Lea <ja...@kumachan.net.nz>.
Here is a link that explains what is needed and a filter to do it...

http://www.anassina.com/struts/i18n/i18n.html


Greg Reddin wrote:

> I don't remember the exact code, but a looong time ago we had to write 
> a Filter that created a request wrapper that properly set the 
> character encoding on request parameters.  Maybe googling that would 
> turn up something.
>
> Greg
>
> ZYD wrote:
>
>> Hi,
>> I have a problem in getting the Chinese charactors from <html:text>,
>> The following is my jsp file:
>> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
>> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>>
>> <html:html>
>> <html:form action="/submit" focus="email">
>>  <head></head>
>>  <body>
>>   <html:text property="email"/>
>>
>>   <html:submit><bean:message key="button.logon"/></html:submit>
>>  </body>
>> </html:form>
>> </html:html>
>> ---------------------------------------------
>> I have two property files, one is for englisn, the other is for 
>> chinese. Both english and chinese can be displayed properly on the 
>> page, except in the text box.
>>
>> When I input chinese charactors in the text box and submit, I cannot 
>> get the chinese charactor in the form bean correctly. The chinese 
>> charactors become some unreadable charactors like ????.
>>
>> There are no special process in the getEmail and setEmail method in 
>> the form bean.
>>
>> Does anybody have similar problem? I need your advice.
>> Any response is appreciated.
>>
>> --bruce
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


-- 
Jason Lea




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


Re: i18n - Chinese charactor problem

Posted by ZYD <el...@hotmail.com>.
Hi Greg, 

Thank you for your fast response.

I do write a filter to set the encoding to GB2312, but if I set the encoding to gb2312 on every page, because this disallow my pages to accept other language charactors, right? Can I set the encoding dynamicly according to user's locale?

This is my filter in my web.xml

<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GB2312</param-value>
</init-param>
<init-param>
<param-name>ignore</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<servlet-name>action</servlet-name>
</filter-mapping>

Thanks again.

--bruce

----- Original Message ----- 
From: "Greg Reddin" <gr...@fnf.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, October 17, 2003 2:48 AM
Subject: Re: i18n - Chinese charactor problem


> I don't remember the exact code, but a looong time ago we had to write a 
> Filter that created a request wrapper that properly set the character 
> encoding on request parameters.  Maybe googling that would turn up 
> something.
> 
> Greg
> 
> ZYD wrote:
> > Hi, 
> > 
> > I have a problem in getting the Chinese charactors from <html:text>, 
> > 
> > The following is my jsp file: 
> > 
> > <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > 
> > <html:html>
> > <html:form action="/submit" focus="email">
> >  <head></head>
> >  <body>
> >   <html:text property="email"/>
> > 
> >   <html:submit><bean:message key="button.logon"/></html:submit>
> >  </body>
> > </html:form>
> > </html:html>
> > ---------------------------------------------
> > I have two property files, one is for englisn, the other is for chinese. 
> > Both english and chinese can be displayed properly on the page, except in the text box.
> > 
> > When I input chinese charactors in the text box and submit, I cannot get the chinese charactor in the form bean correctly. The chinese charactors become some unreadable charactors like ????.
> > 
> > There are no special process in the getEmail and setEmail method in the form bean.
> > 
> > Does anybody have similar problem? I need your advice.
> > Any response is appreciated.
> > 
> > --bruce
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

Re: i18n - Chinese charactor problem

Posted by Greg Reddin <gr...@fnf.com>.
I don't remember the exact code, but a looong time ago we had to write a 
Filter that created a request wrapper that properly set the character 
encoding on request parameters.  Maybe googling that would turn up 
something.

Greg

ZYD wrote:
> Hi, 
> 
> I have a problem in getting the Chinese charactors from <html:text>, 
> 
> The following is my jsp file: 
> 
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> 
> <html:html>
> <html:form action="/submit" focus="email">
>  <head></head>
>  <body>
>   <html:text property="email"/>
> 
>   <html:submit><bean:message key="button.logon"/></html:submit>
>  </body>
> </html:form>
> </html:html>
> ---------------------------------------------
> I have two property files, one is for englisn, the other is for chinese. 
> Both english and chinese can be displayed properly on the page, except in the text box.
> 
> When I input chinese charactors in the text box and submit, I cannot get the chinese charactor in the form bean correctly. The chinese charactors become some unreadable charactors like ????.
> 
> There are no special process in the getEmail and setEmail method in the form bean.
> 
> Does anybody have similar problem? I need your advice.
> Any response is appreciated.
> 
> --bruce


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


i18n - Chinese charactor problem

Posted by ZYD <el...@hotmail.com>.
Hi, 

I have a problem in getting the Chinese charactors from <html:text>, 

The following is my jsp file: 

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html:html>
<html:form action="/submit" focus="email">
 <head></head>
 <body>
  <html:text property="email"/>

  <html:submit><bean:message key="button.logon"/></html:submit>
 </body>
</html:form>
</html:html>
---------------------------------------------
I have two property files, one is for englisn, the other is for chinese. 
Both english and chinese can be displayed properly on the page, except in the text box.

When I input chinese charactors in the text box and submit, I cannot get the chinese charactor in the form bean correctly. The chinese charactors become some unreadable charactors like ????.

There are no special process in the getEmail and setEmail method in the form bean.

Does anybody have similar problem? I need your advice.
Any response is appreciated.

--bruce

Re: [newbie] how does work?

Posted by Kris Schneider <kr...@dotech.com>.
<code>
  <fmt:setBundle basename="ApplicationResources" var="ares" />
  <fmt:message bundle="${ares}" key="message.example.simple" />
</code>

Quoting Christian Martin <ch...@joanneum.at>:

> sorry i did a mistake in my code snipplet but it does not work either.
> 
> the corrected version:
> 
> the code snippet below works fine and i can see the message for the key 
> message.example.simple from my ResourceBundle
> <code>
>  <fmt:bundle basename="ApplicationResources">
>    <fmt:message key="message.example.simple" />
>  </fmt:bundle>
> </code>
> 
> but if i use the setBundle tag
> <code>
>  <fmt:setBundle basename="ApplicationResources" var="ares" />
>  <fmt:message bundle="ares" key="message.example.simple" />
> </code>
> 
> following error occurs
> <error>
>  An error occurred while evaluating custom action attribute "bundle" 
> with value "ares": Attempt to convert String "ares" to type 
> "javax.servlet.jsp.jstl.fmt.LocalizationContext", but there is no 
> PropertyEditor for that type (null)
> </error>
> 
> thanks in advance
> 
> student from austria
> (working on an struts project during internship)
> 
> ---------------------------------
> sorry for my english but i am working hard to improve my english knowledge
> 
> Christian Martin wrote:
> 
> > the code snippet below works fine and i can see the message for the 
> > key message.example.simple from my ResourceBundle
> > <code>
> >  <fmt:bundle basename="ApplicationResources">
> >    <fmt:message key="message.example.simple" />
> >  </fmt:bundle>
> > </code>
> >
> > but if i use the setBundle tag
> > <code>
> >  <fmt:setBundle basename="${ApplicationResources}" var="ares" />
> >  <fmt:message bundle="ares" key="message.example.simple" />
> > </code>
> >
> > following error occurs
> > <error>
> >  An error occurred while evaluating custom action attribute "bundle" 
> > with value "ares": Attempt to convert String "ares" to type 
> > "javax.servlet.jsp.jstl.fmt.LocalizationContext", but there is no 
> > PropertyEditor for that type (null)
> > </error>
> >
> > ---------------------------------
> > sorry for my english but i am working hard to improve my egnlish 
> > knowledge

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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