----- Original Message -----
From: "Philipp Meier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 20, 2004 2:29 PM
Subject: Re: [OS-webwork] Dynamic View Mapping


> Frank Febbraro wrote:
>
>  > Ok I see what is going wrong.
>  >
>  > the view result is:
>  > redirect.action?url=somthing?param1=value1&param2=value2
>  >
>  > What is happening is that it interprets redirect.action as having 2
>  > parameters
>  >
>  > 1) url=somthing?param1=value1
>  > 2) param2=value2
>  >
>  > not sure how to fix it yet...any ideas...
>  >
>  > The only workaround I can see now is to handle the redirect by hand in
the
>  > action instead of usign a view mapping
>
>
> I think you must HttpEncode the  "?" and "&" (untestet, thow)
>
> redirect.action?url=somthing%3Fparam1=value1%26param2=value2
>

Encoding the ? and & characters helps the parameter parsing so that it
considers everything after "url=" to be the value of the url parameter. The
problem is then that when the redirect action uses this and calls
response.sendRedirect then the parameters are still encoded so the redirect
points to some URL which does not exist:
somthing%3Fparam1=value1%26param2=value2

I do not know the details of when parameters should be encoded or decoded.
However I tried changing the parameter parsing slightly so that before the
parameter values are put into the parameter map, then I call
URLDecoder.decode on the value. That will then replace the %xx with the
original ? and & values, so then Billys suggested encoding works for the
redirect and it all seems to work ok, at least for this example.
Does anyone know if it is ok to do like this, or are there situations where
we would break existing applications by doing this? Cases that would not
work? Should we add this to CVS?

Cheers,

Dick Zetterberg






-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to