cannot pass String parameters if they are not encoded with ISO8859-1

2007-05-23 Thread Heping Zhang

hi, all, I write a button and its listener is a onOk method like this:
public IPage onOk() {
  //...
 resultPage.setProfession(prof);
 resultPage.setAddress(add);

 System.err.println(resultPage.getProfession()+resultPage.getAddress()
+resultPage.getProfession()+resultPage.getAddress());

 return resultPage;
}
 at this time the System.err.println method prints right character. In
another page, the resultPage, I have a DirectLink and persist the profession
and address String in the client and then get them back when the client
click the DirectLink. This is my DirectLink :
   component id=gotoPage type=DirectLink
   binding name=listener value=listener:gotoPage/
   binding name=parameters value={profession,address}/
   /component
the DirectLink's listener is something like this:
public void gotoPage(String profession, String address) {
 System.err.println(profession + address);
 //...
}
and the System.err.println just prints characters like ???. If the parameter
is English characters , it works ok. But when it is Chinese characters, it
seems encoded incorrected.
Further more, when I get the result Page in browser, hover the cursor on
that direst link, on the bar in the bottom of browser I can see the link and
it encoded correct. It seems only when the server get the parameter from the
client back, something goes wrong.
Could someone help me?


Re: cannot pass String parameters if they are not encoded with ISO8859-1

2007-05-23 Thread Andreas Andreou

http://confluence.atlassian.com/display/DOC/Configuring+Tomcat's+URI+encoding

On 5/23/07, Heping Zhang [EMAIL PROTECTED] wrote:


hi, all, I write a button and its listener is a onOk method like this:
public IPage onOk() {
   //...
  resultPage.setProfession(prof);
  resultPage.setAddress(add);

  System.err.println(resultPage.getProfession()+resultPage.getAddress()
+resultPage.getProfession()+resultPage.getAddress());

  return resultPage;
}
  at this time the System.err.println method prints right character. In
another page, the resultPage, I have a DirectLink and persist the
profession
and address String in the client and then get them back when the client
click the DirectLink. This is my DirectLink :
component id=gotoPage type=DirectLink
binding name=listener value=listener:gotoPage/
binding name=parameters value={profession,address}/
/component
the DirectLink's listener is something like this:
public void gotoPage(String profession, String address) {
  System.err.println(profession + address);
  //...
}
and the System.err.println just prints characters like ???. If the
parameter
is English characters , it works ok. But when it is Chinese characters, it
seems encoded incorrected.
Further more, when I get the result Page in browser, hover the cursor on
that direst link, on the bar in the bottom of browser I can see the link
and
it encoded correct. It seems only when the server get the parameter from
the
client back, something goes wrong.
Could someone help me?





--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


Re: cannot pass String parameters if they are not encoded with ISO8859-1

2007-05-23 Thread Heping Zhang

oh, you always know the solution! Thank you!