You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Rui Alberto <ru...@ptinovacao.pt> on 2005/06/06 22:09:47 UTC
jx template generator request parameter encoding
Hi all,
I'm having problems when using jx template generator to fetch parameters
from request object when the attribute value as special characters!
If the request parameter "test" has a value like "olá", the fetched
value using ${request.test} becomes "olá"...
When using request generator the correct string (olá) is presented in
the generated xml document.
I've tried changing serializer encoding, container encoding, etc...but
until now a didn't find any solution to solve this problem.
Does anyone has any idea how to solve this problem?
Thanks to all..
Rui
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: jx template generator request parameter encoding
Posted by Rui Alberto <ru...@ptinovacao.pt>.
Yes,
using ${request.getParameter('teste')} instead of ${request.teste} makes
the diference.
Thanks Reinhard for the help.
Rui
On Tue, 2005-06-07 at 09:17 +0200, Geert Josten wrote:
> >>> Have you tried cocoon.request.getParameter('test') instead of
> >>> cocoon.request.test?
> >>
> >> I don't think getParameter will make a difference.
> >
> > Citing http://wiki.apache.org/cocoon/RequestParameterEncoding
> >
> > [...]
> > For Java-insiders: what Cocoon actually does internally is apply the
> > following trick to get a parameter correctly decoded: suppose "value" is
> > a string containing a request parameter, then Cocoon will do:
> >
> > value = new String(value.getBytes("ISO-8859-1"), "UTF-8");
> > [...]
> >
> > IIRC, the property reflection methods don't use this ... but maybe I'm
> > wrong.
>
> I was thinking that getting a property was simply translated to a getParameter by the FOM wrapper,
> but I guess you are right. Properties are handled by the Rhino interpreter (JS Flowscript), while
> getParameter is a function in the FOM request wrapper object.
>
> :-P
>
> (sorry ;)
>
> G.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: jx template generator request parameter encoding
Posted by Geert Josten <Ge...@daidalos.nl>.
>>> Have you tried cocoon.request.getParameter('test') instead of
>>> cocoon.request.test?
>>
>> I don't think getParameter will make a difference.
>
> Citing http://wiki.apache.org/cocoon/RequestParameterEncoding
>
> [...]
> For Java-insiders: what Cocoon actually does internally is apply the
> following trick to get a parameter correctly decoded: suppose "value" is
> a string containing a request parameter, then Cocoon will do:
>
> value = new String(value.getBytes("ISO-8859-1"), "UTF-8");
> [...]
>
> IIRC, the property reflection methods don't use this ... but maybe I'm
> wrong.
I was thinking that getting a property was simply translated to a getParameter by the FOM wrapper,
but I guess you are right. Properties are handled by the Rhino interpreter (JS Flowscript), while
getParameter is a function in the FOM request wrapper object.
:-P
(sorry ;)
G.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: jx template generator request parameter encoding
Posted by Reinhard Poetz <re...@apache.org>.
Geert Josten wrote:
>>> I've tried changing serializer encoding, container encoding, etc...but
>>> until now a didn't find any solution to solve this problem.
>>
>>
>> Have you tried cocoon.request.getParameter('test') instead of
>> cocoon.request.test?
>
>
> I don't think getParameter will make a difference.
Citing http://wiki.apache.org/cocoon/RequestParameterEncoding
[...]
For Java-insiders: what Cocoon actually does internally is apply the following
trick to get a parameter correctly decoded: suppose "value" is a string
containing a request parameter, then Cocoon will do:
value = new String(value.getBytes("ISO-8859-1"), "UTF-8");
[...]
IIRC, the property reflection methods don't use this ... but maybe I'm wrong.
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: jx template generator request parameter encoding
Posted by Geert Josten <Ge...@daidalos.nl>.
>> I've tried changing serializer encoding, container encoding, etc...but
>> until now a didn't find any solution to solve this problem.
>
> Have you tried cocoon.request.getParameter('test') instead of
> cocoon.request.test?
I don't think getParameter will make a difference.
Have you tried adding the correct encoding to the JX template itself?
:-)
HTH,
Geert
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: jx template generator request parameter encoding
Posted by Reinhard Poetz <re...@apache.org>.
Rui Alberto wrote:
> Hi all,
> I'm having problems when using jx template generator to fetch parameters
> from request object when the attribute value as special characters!
>
> If the request parameter "test" has a value like "olá", the fetched
> value using ${request.test} becomes "olá"...
>
> When using request generator the correct string (olá) is presented in
> the generated xml document.
>
> I've tried changing serializer encoding, container encoding, etc...but
> until now a didn't find any solution to solve this problem.
>
> Does anyone has any idea how to solve this problem?
Have you tried cocoon.request.getParameter('test') instead of cocoon.request.test?
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org