You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Heping Zhang <ph...@gmail.com> on 2007/05/23 17:02:03 UTC
cannot pass String parameters if they are not encoded with ISO8859-1
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
Posted by Heping Zhang <ph...@gmail.com>.
oh, you always know the solution! Thank you!
Re: cannot pass String parameters if they are not encoded with ISO8859-1
Posted by Andreas Andreou <an...@di.uoa.gr>.
http://confluence.atlassian.com/display/DOC/Configuring+Tomcat's+URI+encoding
On 5/23/07, Heping Zhang <ph...@gmail.com> 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 - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting