You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Ate Douma (JIRA)" <ji...@apache.org> on 2007/06/14 16:53:26 UTC

[jira] Commented: (WICKET-649) New Wicket Portlet support: fix appending query parameters

    [ https://issues.apache.org/jira/browse/WICKET-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504758 ] 

Ate Douma commented on WICKET-649:
----------------------------------

In wicket-ajax.js function createUrl and AbstractAjaxBehavior.getCallbackUrl(boolean), parameters are simply appended to a wicket url using &.
In a web application environment this is valid as the base wicket url is always (???) using a query string so the required initial ? to mark the start of the query string is already provided.

But PortletURLs are (and must be) self contained, and are not under control of Wicket.
And as it is unknown to the portlet how PortletURLs are constructed, one cannot assume the resulting url will already have a query string parameter defined.
In the default Jetspeed-2  configuration, this indeed won't be the case (the Wicket url will be encoded as path parameter, not query parameter).

I'm going to provide a simple fix:
  url.append(url.indexOf("?") > -1 ? '&' : '?').append(<parameter>) 

This fix is non-intrusive, so I think it can be applied to the wicket core trunk as well without any harm.

But there is a more serious problem here: appending parameters to a generated PortletURL is *not* supported by the Portlet API!
Jetspeed-2 does allow this optionally though, so for the time being I can get this to work as intended, but in the end and to be really "portable",
Component.urlFor(IBehavior, RequestListenerInterface) will need to be enhanced/extended to have it embed the WebRequestCodingStrategy.IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME parameter directly into the url so appending it won't be needed anymore.
That's much more intrusive though, so I've postponed doing that and needs to be discussed further on the dev list first.


> New Wicket Portlet support: fix appending query parameters
> ----------------------------------------------------------
>
>                 Key: WICKET-649
>                 URL: https://issues.apache.org/jira/browse/WICKET-649
>             Project: Wicket
>          Issue Type: Sub-task
>            Reporter: Ate Douma
>            Assignee: Ate Douma
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.