You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "demir kiracoglu (JIRA)" <ji...@apache.org> on 2008/02/15 18:10:09 UTC

[jira] Commented: (WICKET-1343) HybridUrlCodingStrategy and StatelessForm ( or StatelessLink ) results in invalid parameter encoding

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

demir kiracoglu commented on WICKET-1343:
-----------------------------------------

The same problem occurs when you use IndexedHybridUrlCodingStrategy. Actually for the above, i changed newPage() method on HybridUrlCodingStrategy  like this,

protected Page newPage(Class pageClass, RequestCycle requestCycle)
		{
			Page page = super.newPage(pageClass, requestCycle);
			page.setMetaData(PAGE_PARAMETERS_META_DATA_KEY,
				(Serializable)getPageParameters().clone());
			page.setMetaData(ORIGINAL_TRAILING_SLASHES_COUNT_METADATA_KEY, new Integer(
				originalUrlTrailingSlashesCount));
			return page;
		}

Now there is no problem. It works. But i couldn't figure out how to change IndexedHybridUrlCodingStrategy. There is such code inside the method name  "appendParameters" on this file which throws exception

if (i != parameters.size())
		{
			throw new WicketRuntimeException(
					"Not all parameters were encoded. Make sure all parameter names are integers in consecutive order starting with zero. Current parameter names are: " +
							parameters.keySet().toString());
		}

The problem is, if you set one page parameter with key "0", then StatelessForm ( or StatelessLink  ) also adds another one with key "wicket:interface" So the size of the parameters map is not equal to "i" variable.

I'm trying to find the right way but i need some help. Is there anybody reading these issues ? 



> HybridUrlCodingStrategy and StatelessForm ( or StatelessLink ) results in invalid parameter encoding
> ----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1343
>                 URL: https://issues.apache.org/jira/browse/WICKET-1343
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: demir kiracoglu
>
> I put a header component on one of my pages which contains a statelessform ( or stateless link ) .  I mounted the page with a HybridUrlCodingStrategy . When you request the page like this
> http://localhost:9696/mountpath/param1/param1value, 
> stateless form attaches another parameter which shows the forms IFormListener target. The new url is like this :
> http://localhost:9696/mountpath/param1/param1value/wicket:interface/%3A0%3Aheader%3AloggedOutView%3AloginForm%3A%3AIFormSubmitListener%3A%3A/.0
> I haven't covered all the source code for now but  i think the form changes the page parameters object so i think HybridUrlCodingStrategy must clone initial page parameters before putting it to page metadata. But not sure that this will cause any other problems 

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