I believe this is a feature of the servletcontainer.
You cannot add requestparameters when the request is processing already, so a
forward can't really change the querystring in that way and get it reparsed
into requestparameters.
You can parse the querystring manually though in your jsp if you feel like
messing around with that kind of code. Should probably do it in a taglib-tag if
you want to write code directly on the httpservletrequest.
There is of course always the overengineered aproach...
You can add a filter that dispatches on forward, that wraps the request in your
own implementation of HttpServletRequestWrapper, that manages a map of your own
"home-parsed" parameters which it exposes on getparameter and such calls.
This would allow you to write code in you jsp that looks and feels just like
you have now, and kind of plugin a fix this way.
I believe I would take the first approach unless I had made a lot of jsp-pages
like this and didn't want to go around the application rewriting them.
Hope I made some sense there ;)
/Åke
2 dec 2009 kl. 17.21 skrev Matteo Pelucco:
>
> Hello Magnolians!
> Question time:
>
> I have a virtual uri mapping set in this way:
>
> --- --- ---
> class : info.magnolia.cms.beans.config.RegexpVirtualURIMapping
> fromUri : /landingPage(/.*)$
> toUri : forward:/path/to/landingPage.html?pathWas=$1
> --- --- ---
>
> The scenario is that: I would like to pass the parameter "pathWas" to
> landingPage only if the page is called by the virtual uri.
>
> In this configuration it doesn't work, e.g., if I call
> www.mysite.com/landingPage/this/is/a/fake/path
> =>
> - request.getParameter("pathWas") is null
> - url in the browser is (as expected)
>
> But if I change this:
> toUri : forward:/path/to/landingPage.html?pathWas=$1
>
> in:
> toUri : redirect:/path/to/landingPage.html?pathWas=$1
>
> everything works, but I see in the url the real path of the landing page.
> E.g., if I call
> www.mysite.com/landingPage/this/is/a/fake/path
> =>
> - request.getParameter("pathWas") is "this/is/a/fake/path".
> - url in the browser is (again as expected)
> www.mysite.com/path/to/landingPage.html?pathWas=/this/is/a/fake/path
>
> Does anybody help me to know why?
> The VirtualUriMappingFilter code seems to be OK.
>
> Thanks *a lot* for any hint.
> Matteo
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
>
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------