[
https://issues.apache.org/jira/browse/WICKET-4441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224401#comment-13224401
]
Tsutomu YANO edited comment on WICKET-4441 at 3/7/12 3:24 PM:
--
I know that the PageParameters object is that contains the GET parameters which
ware available when the page was created, because it is described in Javadoc.
Truly, THAT was a reason I post this issue as a BUG.
Before I post this issue, same as you wrote in previous post, I thought that I
could get the new parameter-value from getRequest().getRequestParameters(). But
I couldn't, because getRequest().getRequestParameters() doesn't contain the
parameters which encoded into mount-path like '/mount-path/${parameter-name}',
but it contains only current query-parameters and post-parameters. Because the
encoded parameters are not query-parameters nor post-parameters. Simplly a
part of url.
I attach a new sample project where I log all parameter-keys and values of
getRequest().getRequestParameter() in onBeforeRender(). That doesn't contain
the parameters encoded into mount-path.
(Note: a attached project references wicket 1.5.4 statically for testing. But
same with wicket-1.5-SNAPSHOT.)
Our problem is that we have no way to easily get parameter-values from
mount-path. We can get parameter-values of query-parameters and
post-parameters, because wicket provide the way through getRequestParameters(),
getQueryParameters() or getPostParameters(). But there is no way to get the
parameters encoded into url.
The only way to retrieve the values from url is that we do same thing which
MountedMapper do. Is it the right way to do that in wicket? I can not believe
it.
summary:
1. PageParameters is the object which contains the parameters which the page is
created (it is decribed in JavaDoc, so we can not change the behavior easily).
2. getRequest().getRequestParameters() contains only query-parameters and
post-parameters, but doesn't contain parameters which encoded into url by
mount-path (the function for encoding parameters into URL is introduced from
wicket 1.5, so older versions don't have this issue, I think.).
3. There is no easy way to retrieve parameter-values from URL (I think the only
way is doing same thing MountedMapper do).
4. So the only easily implementable and ligically acceptable way to provide ALL
CURRENT parameters (including parameters encoded into url) for users is that we
reconstruct a new page if a part of parameters is changed. Users can get all
current parameters from PageParameters.
If URL is changed, the page object is newly created. Parameters encoded into
URL are a part of URL, so it is acceptable for me.
If there are another easy ways already, this ticket is my mistake, but I could
not find them. I think, if creating a new page instance for each
parameter-change is not acceptable for you, (I hope) you should provide another
way to retrieve ALL CURRENT PARAMETER VALUES easily for our users of Wicket. We
can retrieve query-parameters and post-parameters easily, but not parameters
encoded into url.
was (Author: t_yano):
I know that the PageParameters object is that contains the GET parameters
which ware available when the page was created, because it is described in
Javadoc. Truly, THAT was a reason I post this issue as a BUG.
Before I post this issue, same as you wrote in previous post, I thought that I
could get the new parameter-value from getRequest().getRequestParameters(). But
I couldn't, because getRequest().getRequestParameters() doesn't contain the
parameters which encoded into mount-path like '/mount-path/${parameter-name}',
but it contains only current query-parameters and post-parameters. Because the
encoded parameters are not query-parameters nor post-parameters. Simplly a
part of url.
I attach a new sample project where I log all parameter-keys and values of
getRequest().getRequestParameter() in onBeforeRender(). That doesn't contain
the parameters encoded into mount-path.
(Note: a attached project references wicket 1.5.4 statically for testing. But
same with wicket-1.5-SNAPSHOT.)
Our problem is that we have no way to easily get parameter-values from
mount-path. We can get parameter-values of query-parameters and
post-parameters, because wicket provide the way through getRequestParameters(),
getQueryParameters() or getPostParameters(). But there is no way to get the
parameters encoded into url.
The only way to retrieve the values from url is that we do same thing which
MountedMapper do. Is it the right way to do that in wicket? I can not believe
it.
summary:
1. PageParameters is the object which contains the parameters which the page is
created (it is decribed in JavaDoc, so we can not change the behavior easily).
2. getRequest().getRequestParameters() contains only query-parameters and