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

Dan Retzlaff commented on WICKET-3956:
--------------------------------------

Martin, yes I am subclassing the coding strategy now.
Igor, I don't disagree with anything you said except "clean manner", as this is 
the required override. :)

        @Override
        public IRequestTarget decode(RequestParameters requestParameters) {
                String parametersFragment = 
requestParameters.getPath().substring(getMountPath().length());
                PageInfoExtraction extraction = 
extractPageInfo(parametersFragment);
                PageParameters parameters = new PageParameters(decodeParameters(
                                extraction.getUrlAfterExtraction(), 
requestParameters.getParameters()));
                
                String interfaceParameter = (String) 
parameters.remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
                if (interfaceParameter != null) {
                        
WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter, 
requestParameters);
                }
                
                if (requestParameters.getInterfaceName() != null) {
                        PageInfo pageInfo = extraction.getPageInfo();
                        String pageMapName = pageInfo != null ? 
pageInfo.getPageMapName() : null;

                        return new 
BookmarkableListenerInterfaceRequestTarget(pageMapName, pageClassRef.get(),
                                        parameters, 
requestParameters.getComponentPath(),
                                        requestParameters.getInterfaceName(), 
requestParameters.getVersionNumber());
                }
                return super.decode(requestParameters);
        }

                
> (Indexed|MixedParam)HybridUrlCodingStrategy ignore interface parameter
> ----------------------------------------------------------------------
>
>                 Key: WICKET-3956
>                 URL: https://issues.apache.org/jira/browse/WICKET-3956
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.18
>            Reporter: Dan Retzlaff
>            Assignee: Igor Vaynberg
>         Attachments: myproject.zip, myproject.zip, wicket-3956.patch
>
>
> Whereas BookmarkablePageRequestTargetUrlCodingStrategy looks to both the 
> decoded parameters *and* the request parameters for an interface, 
> HybridUrlCodingStrategy does not. This means its MixedParam and Indexed 
> subclasses, for which not all parameters are encoded in the URL, get decoded 
> into HybridBookmarkablePageRequestTargets instead of 
> BookmarkableListenerInterfaceRequestTarget. In my application, this causes 
> form submits to break.
> The attached patch modifies testStatelessHybridUrlCodingStrategy to use the 
> MixedParamHybridUrlCodingStrategy instead of HybridUrlCodingStrategy to 
> demonstrate the issue. It also includes a fix.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to