You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Chris Lintz <ch...@gmail.com> on 2007/09/14 06:35:13 UTC

Bug in IndexedParamUrlCodingStrategy 1.3 Beta3

Hi all,
So i think there is a bug in IndexedParamUrlCodingStrategy .  I have this
simple mount in my extened WebApplication:

   mount(new IndexedParamUrlCodingStrategy("/joinme",
InviteAcceptancePage.class));


In my InviteAcceptancePage class, i simply do this snippet of code:

public InviteAcceptancePage(PageParameters params)
{
   String code = params.getString("0");
   logger.debug("code:"+code);
   ...

}
When i do this in my browser for example: 
http://www.mydomain.com/joinme/55555

The following 55555 parameter is logged just fine, but after the constructor
returns I get the below exception:

22:23:43,600 ERROR [RequestCycle] Not all parameters were encoded. Make sure
all parameter names are integers in consecutive order starting with zero.
Current parameter names are: [wicket:interface]
org.apache.wicket.WicketRuntimeException: Not all parameters were encoded.
Make sure all parameter names are integers in consecutive order



Any ideas?

thanks
-- 
View this message in context: http://www.nabble.com/Bug-in-IndexedParamUrlCodingStrategy-1.3-Beta3-tf4440109.html#a12668353
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Bug in IndexedParamUrlCodingStrategy 1.3 Beta3

Posted by Chris Lintz <ch...@gmail.com>.
yeah sorry i missed that last line in your post or I wouldnt have submitted. 
I guess better 2 Jira's for it than none :)

Sebastiaan van Erk wrote:
> 
> Maybe WICKET-950 should be marked as a duplicate of this one then.
> 
> Regards,
> Sebastiaan
> 
> Chris Lintz wrote:
>> I Have submitted the following Jira on this issue:
>> http://issues.apache.org/jira/browse/WICKET-976
>> 
>> 
>> Chris Lintz wrote:
>>> Actually I just realized what causes this but have no idea how to get
>>> past
>>> it. The InviteAcceptacePage has a Panel within another Panel.  The
>>> nested
>>> Panel contains a simple form submit button.  The IndexParamUrlStrategy's
>>> appendParameters() function is called  with this Map parameters (from an
>>> eclipse debug):
>>>
>>> wicket:interface =
>>> ":4:moduleColumnPanel:moduleColumnFrag:loginPanel:loginBoxPanel:loginBox:lFrm::IFormSubmitListener::"
>>>
>>> Here is the appendParameters() function inside
>>> IndexedParamUrlCodingStrategy:
>>>
>>> protected void appendParameters(AppendingStringBuffer url, Map
>>> parameters)
>>> 	{
>>> 		int i;
>>> 		for (i = 0; parameters.containsKey(String.valueOf(i)); i++)
>>> 		{
>>> 			String value = (String) parameters.get(String.valueOf(i));
>>> 			if (!url.endsWith("/"))
>>> 				url.append("/");
>>> 			url.append(urlEncode(value)).append("/");
>>> 		}
>>>
>>> 		String pageMap = (String) parameters.get("wicket:pageMapName");
>>> 		if (pageMap != null)
>>> 		{
>>> 			i++;
>>> 			pageMap = WebRequestCodingStrategy.encodePageMapName(pageMap);
>>> 			if (!url.endsWith("/"))
>>> 				url.append("/");
>>> 		
>>> url.append("wicket:pageMapName").append("/").append(urlEncode(pageMap)).append("/");
>>> 		}
>>> 		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());
>>> 		else
>>> 			return;
>>> 	}
>>>
>>> The pagemap is null and the statement if (i != parameters.size())
>>> evaluates to true and generates the error.
>>>
>>> Why does the panel with these Map parameters generate the error inside
>>> that function? 
>>>
>>>
>>>
>>> thanks for any help
>>>
>>>
>>>
>>>
>>> Chris Lintz wrote:
>>>> Hi all,
>>>> So i think there is a bug in IndexedParamUrlCodingStrategy .  I have
>>>> this
>>>> simple mount in my extened WebApplication:
>>>>
>>>>    mount(new IndexedParamUrlCodingStrategy("/joinme",
>>>> InviteAcceptancePage.class));
>>>>
>>>>
>>>> In my InviteAcceptancePage class, i simply do this snippet of code:
>>>>
>>>> public InviteAcceptancePage(PageParameters params)
>>>> {
>>>>    String code = params.getString("0");
>>>>    logger.debug("code:"+code);
>>>>    ...
>>>>
>>>> }
>>>> When i do this in my browser for example: 
>>>> http://www.mydomain.com/joinme/55555
>>>>
>>>> The following 55555 parameter is logged just fine, but after the
>>>> constructor returns I get the below exception:
>>>>
>>>> 22:23:43,600 ERROR [RequestCycle] Not all parameters were encoded. Make
>>>> sure all parameter names are integers in consecutive order starting
>>>> with
>>>> zero. Current parameter names are: [wicket:interface]
>>>> org.apache.wicket.WicketRuntimeException: Not all parameters were
>>>> encoded. Make sure all parameter names are integers in consecutive
>>>> order
>>>>
>>>>
>>>>
>>>> Any ideas?
>>>>
>>>> thanks
>>>>
>>>
>> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/Bug-in-IndexedParamUrlCodingStrategy-1.3-Beta3-tf4440109.html#a12680931
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Bug in IndexedParamUrlCodingStrategy 1.3 Beta3

Posted by Sebastiaan van Erk <se...@sebster.com>.
Maybe WICKET-950 should be marked as a duplicate of this one then.

Regards,
Sebastiaan

Chris Lintz wrote:
> I Have submitted the following Jira on this issue:
> http://issues.apache.org/jira/browse/WICKET-976
> 
> 
> Chris Lintz wrote:
>> Actually I just realized what causes this but have no idea how to get past
>> it. The InviteAcceptacePage has a Panel within another Panel.  The nested
>> Panel contains a simple form submit button.  The IndexParamUrlStrategy's
>> appendParameters() function is called  with this Map parameters (from an
>> eclipse debug):
>>
>> wicket:interface =
>> ":4:moduleColumnPanel:moduleColumnFrag:loginPanel:loginBoxPanel:loginBox:lFrm::IFormSubmitListener::"
>>
>> Here is the appendParameters() function inside
>> IndexedParamUrlCodingStrategy:
>>
>> protected void appendParameters(AppendingStringBuffer url, Map parameters)
>> 	{
>> 		int i;
>> 		for (i = 0; parameters.containsKey(String.valueOf(i)); i++)
>> 		{
>> 			String value = (String) parameters.get(String.valueOf(i));
>> 			if (!url.endsWith("/"))
>> 				url.append("/");
>> 			url.append(urlEncode(value)).append("/");
>> 		}
>>
>> 		String pageMap = (String) parameters.get("wicket:pageMapName");
>> 		if (pageMap != null)
>> 		{
>> 			i++;
>> 			pageMap = WebRequestCodingStrategy.encodePageMapName(pageMap);
>> 			if (!url.endsWith("/"))
>> 				url.append("/");
>> 		
>> url.append("wicket:pageMapName").append("/").append(urlEncode(pageMap)).append("/");
>> 		}
>> 		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());
>> 		else
>> 			return;
>> 	}
>>
>> The pagemap is null and the statement if (i != parameters.size())
>> evaluates to true and generates the error.
>>
>> Why does the panel with these Map parameters generate the error inside
>> that function? 
>>
>>
>>
>> thanks for any help
>>
>>
>>
>>
>> Chris Lintz wrote:
>>> Hi all,
>>> So i think there is a bug in IndexedParamUrlCodingStrategy .  I have this
>>> simple mount in my extened WebApplication:
>>>
>>>    mount(new IndexedParamUrlCodingStrategy("/joinme",
>>> InviteAcceptancePage.class));
>>>
>>>
>>> In my InviteAcceptancePage class, i simply do this snippet of code:
>>>
>>> public InviteAcceptancePage(PageParameters params)
>>> {
>>>    String code = params.getString("0");
>>>    logger.debug("code:"+code);
>>>    ...
>>>
>>> }
>>> When i do this in my browser for example: 
>>> http://www.mydomain.com/joinme/55555
>>>
>>> The following 55555 parameter is logged just fine, but after the
>>> constructor returns I get the below exception:
>>>
>>> 22:23:43,600 ERROR [RequestCycle] Not all parameters were encoded. Make
>>> sure all parameter names are integers in consecutive order starting with
>>> zero. Current parameter names are: [wicket:interface]
>>> org.apache.wicket.WicketRuntimeException: Not all parameters were
>>> encoded. Make sure all parameter names are integers in consecutive order
>>>
>>>
>>>
>>> Any ideas?
>>>
>>> thanks
>>>
>>
> 

Re: Bug in IndexedParamUrlCodingStrategy 1.3 Beta3

Posted by Igor Vaynberg <ig...@gmail.com>.
thanks

-igor


On 9/14/07, Chris Lintz <ch...@gmail.com> wrote:
>
>
> I Have submitted the following Jira on this issue:
> http://issues.apache.org/jira/browse/WICKET-976
>
>
> Chris Lintz wrote:
> >
> > Actually I just realized what causes this but have no idea how to get
> past
> > it. The InviteAcceptacePage has a Panel within another Panel.  The
> nested
> > Panel contains a simple form submit button.  The IndexParamUrlStrategy's
> > appendParameters() function is called  with this Map parameters (from an
> > eclipse debug):
> >
> > wicket:interface =
> >
> ":4:moduleColumnPanel:moduleColumnFrag:loginPanel:loginBoxPanel:loginBox:lFrm::IFormSubmitListener::"
> >
> > Here is the appendParameters() function inside
> > IndexedParamUrlCodingStrategy:
> >
> > protected void appendParameters(AppendingStringBuffer url, Map
> parameters)
> >       {
> >               int i;
> >               for (i = 0; parameters.containsKey(String.valueOf(i));
> i++)
> >               {
> >                       String value = (String) parameters.get(
> String.valueOf(i));
> >                       if (!url.endsWith("/"))
> >                               url.append("/");
> >                       url.append(urlEncode(value)).append("/");
> >               }
> >
> >               String pageMap = (String) parameters.get
> ("wicket:pageMapName");
> >               if (pageMap != null)
> >               {
> >                       i++;
> >                       pageMap =
> WebRequestCodingStrategy.encodePageMapName(pageMap);
> >                       if (!url.endsWith("/"))
> >                               url.append("/");
> >
> > url.append
> ("wicket:pageMapName").append("/").append(urlEncode(pageMap)).append("/");
> >               }
> >               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());
> >               else
> >                       return;
> >       }
> >
> > The pagemap is null and the statement if (i != parameters.size())
> > evaluates to true and generates the error.
> >
> > Why does the panel with these Map parameters generate the error inside
> > that function?
> >
> >
> >
> > thanks for any help
> >
> >
> >
> >
> > Chris Lintz wrote:
> >>
> >> Hi all,
> >> So i think there is a bug in IndexedParamUrlCodingStrategy .  I have
> this
> >> simple mount in my extened WebApplication:
> >>
> >>    mount(new IndexedParamUrlCodingStrategy("/joinme",
> >> InviteAcceptancePage.class));
> >>
> >>
> >> In my InviteAcceptancePage class, i simply do this snippet of code:
> >>
> >> public InviteAcceptancePage(PageParameters params)
> >> {
> >>    String code = params.getString("0");
> >>    logger.debug("code:"+code);
> >>    ...
> >>
> >> }
> >> When i do this in my browser for example:
> >> http://www.mydomain.com/joinme/55555
> >>
> >> The following 55555 parameter is logged just fine, but after the
> >> constructor returns I get the below exception:
> >>
> >> 22:23:43,600 ERROR [RequestCycle] Not all parameters were encoded. Make
> >> sure all parameter names are integers in consecutive order starting
> with
> >> zero. Current parameter names are: [wicket:interface]
> >> org.apache.wicket.WicketRuntimeException: Not all parameters were
> >> encoded. Make sure all parameter names are integers in consecutive
> order
> >>
> >>
> >>
> >> Any ideas?
> >>
> >> thanks
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Bug-in-IndexedParamUrlCodingStrategy-1.3-Beta3-tf4440109.html#a12678916
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Bug in IndexedParamUrlCodingStrategy 1.3 Beta3

Posted by Chris Lintz <ch...@gmail.com>.
I Have submitted the following Jira on this issue:
http://issues.apache.org/jira/browse/WICKET-976


Chris Lintz wrote:
> 
> Actually I just realized what causes this but have no idea how to get past
> it. The InviteAcceptacePage has a Panel within another Panel.  The nested
> Panel contains a simple form submit button.  The IndexParamUrlStrategy's
> appendParameters() function is called  with this Map parameters (from an
> eclipse debug):
> 
> wicket:interface =
> ":4:moduleColumnPanel:moduleColumnFrag:loginPanel:loginBoxPanel:loginBox:lFrm::IFormSubmitListener::"
> 
> Here is the appendParameters() function inside
> IndexedParamUrlCodingStrategy:
> 
> protected void appendParameters(AppendingStringBuffer url, Map parameters)
> 	{
> 		int i;
> 		for (i = 0; parameters.containsKey(String.valueOf(i)); i++)
> 		{
> 			String value = (String) parameters.get(String.valueOf(i));
> 			if (!url.endsWith("/"))
> 				url.append("/");
> 			url.append(urlEncode(value)).append("/");
> 		}
> 
> 		String pageMap = (String) parameters.get("wicket:pageMapName");
> 		if (pageMap != null)
> 		{
> 			i++;
> 			pageMap = WebRequestCodingStrategy.encodePageMapName(pageMap);
> 			if (!url.endsWith("/"))
> 				url.append("/");
> 		
> url.append("wicket:pageMapName").append("/").append(urlEncode(pageMap)).append("/");
> 		}
> 		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());
> 		else
> 			return;
> 	}
> 
> The pagemap is null and the statement if (i != parameters.size())
> evaluates to true and generates the error.
> 
> Why does the panel with these Map parameters generate the error inside
> that function? 
> 
> 
> 
> thanks for any help
> 
> 
> 
> 
> Chris Lintz wrote:
>> 
>> Hi all,
>> So i think there is a bug in IndexedParamUrlCodingStrategy .  I have this
>> simple mount in my extened WebApplication:
>> 
>>    mount(new IndexedParamUrlCodingStrategy("/joinme",
>> InviteAcceptancePage.class));
>> 
>> 
>> In my InviteAcceptancePage class, i simply do this snippet of code:
>> 
>> public InviteAcceptancePage(PageParameters params)
>> {
>>    String code = params.getString("0");
>>    logger.debug("code:"+code);
>>    ...
>> 
>> }
>> When i do this in my browser for example: 
>> http://www.mydomain.com/joinme/55555
>> 
>> The following 55555 parameter is logged just fine, but after the
>> constructor returns I get the below exception:
>> 
>> 22:23:43,600 ERROR [RequestCycle] Not all parameters were encoded. Make
>> sure all parameter names are integers in consecutive order starting with
>> zero. Current parameter names are: [wicket:interface]
>> org.apache.wicket.WicketRuntimeException: Not all parameters were
>> encoded. Make sure all parameter names are integers in consecutive order
>> 
>> 
>> 
>> Any ideas?
>> 
>> thanks
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Bug-in-IndexedParamUrlCodingStrategy-1.3-Beta3-tf4440109.html#a12678916
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Bug in IndexedParamUrlCodingStrategy 1.3 Beta3

Posted by Chris Lintz <ch...@gmail.com>.
Actually I just realized what causes this but have no idea how to get past
it. The InviteAcceptacePage has a Panel within another Panel.  The nested
Panel contains a simple form submit button.  The IndexParamUrlStrategy's
appendParameters() function is called  with this Map parameters (from an
eclipse debug):

wicket:interface =
":4:moduleColumnPanel:moduleColumnFrag:loginPanel:loginBoxPanel:loginBox:lFrm::IFormSubmitListener::"

Here is the appendParameters() function inside
IndexedParamUrlCodingStrategy:

protected void appendParameters(AppendingStringBuffer url, Map parameters)
	{
		int i;
		for (i = 0; parameters.containsKey(String.valueOf(i)); i++)
		{
			String value = (String) parameters.get(String.valueOf(i));
			if (!url.endsWith("/"))
				url.append("/");
			url.append(urlEncode(value)).append("/");
		}

		String pageMap = (String) parameters.get("wicket:pageMapName");
		if (pageMap != null)
		{
			i++;
			pageMap = WebRequestCodingStrategy.encodePageMapName(pageMap);
			if (!url.endsWith("/"))
				url.append("/");
		
url.append("wicket:pageMapName").append("/").append(urlEncode(pageMap)).append("/");
		}
		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());
		else
			return;
	}

The pagemap is null and the statement if (i != parameters.size()) evaluates
to true and generates the error.

Why does the panel with these Map parameters generate the error inside that
function? 



thanks for any help




Chris Lintz wrote:
> 
> Hi all,
> So i think there is a bug in IndexedParamUrlCodingStrategy .  I have this
> simple mount in my extened WebApplication:
> 
>    mount(new IndexedParamUrlCodingStrategy("/joinme",
> InviteAcceptancePage.class));
> 
> 
> In my InviteAcceptancePage class, i simply do this snippet of code:
> 
> public InviteAcceptancePage(PageParameters params)
> {
>    String code = params.getString("0");
>    logger.debug("code:"+code);
>    ...
> 
> }
> When i do this in my browser for example: 
> http://www.mydomain.com/joinme/55555
> 
> The following 55555 parameter is logged just fine, but after the
> constructor returns I get the below exception:
> 
> 22:23:43,600 ERROR [RequestCycle] Not all parameters were encoded. Make
> sure all parameter names are integers in consecutive order starting with
> zero. Current parameter names are: [wicket:interface]
> org.apache.wicket.WicketRuntimeException: Not all parameters were encoded.
> Make sure all parameter names are integers in consecutive order
> 
> 
> 
> Any ideas?
> 
> thanks
> 

-- 
View this message in context: http://www.nabble.com/Bug-in-IndexedParamUrlCodingStrategy-1.3-Beta3-tf4440109.html#a12669640
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Bug in IndexedParamUrlCodingStrategy 1.3 Beta3

Posted by Chris Lintz <ch...@gmail.com>.
Yes I am using a stateless login form.  Wow.  Thanks for getting that
response out.  I was able to see exactly where it fails inside the
appendParameters() function of the IndexParamUrlCodingStrategy (see my
follow up post).  Now that you mention the stateless form, it seems it must
simply not know how to handle the Map parmeters sent in.  As well the
pagemap is null.


Sebastiaan van Erk wrote:
> 
> I had the same problem; it was caused by a StatelessForm on the page. 
> When replacing StatelessForm with Form it went away. Are you using a 
> stateless form as well?
> 
> BTW, I made a JIRA issue for this:
> https://issues.apache.org/jira/browse/WICKET-950
> 
> Regards,
> Sebastiaan
> 
> Chris Lintz wrote:
>> Hi all,
>> So i think there is a bug in IndexedParamUrlCodingStrategy .  I have this
>> simple mount in my extened WebApplication:
>> 
>>    mount(new IndexedParamUrlCodingStrategy("/joinme",
>> InviteAcceptancePage.class));
>> 
>> 
>> In my InviteAcceptancePage class, i simply do this snippet of code:
>> 
>> public InviteAcceptancePage(PageParameters params)
>> {
>>    String code = params.getString("0");
>>    logger.debug("code:"+code);
>>    ...
>> 
>> }
>> When i do this in my browser for example: 
>> http://www.mydomain.com/joinme/55555
>> 
>> The following 55555 parameter is logged just fine, but after the
>> constructor
>> returns I get the below exception:
>> 
>> 22:23:43,600 ERROR [RequestCycle] Not all parameters were encoded. Make
>> sure
>> all parameter names are integers in consecutive order starting with zero.
>> Current parameter names are: [wicket:interface]
>> org.apache.wicket.WicketRuntimeException: Not all parameters were
>> encoded.
>> Make sure all parameter names are integers in consecutive order
>> 
>> 
>> 
>> Any ideas?
>> 
>> thanks
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/Bug-in-IndexedParamUrlCodingStrategy-1.3-Beta3-tf4440109.html#a12669643
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Bug in IndexedParamUrlCodingStrategy 1.3 Beta3

Posted by Sebastiaan van Erk <se...@sebster.com>.
I had the same problem; it was caused by a StatelessForm on the page. 
When replacing StatelessForm with Form it went away. Are you using a 
stateless form as well?

BTW, I made a JIRA issue for this:
https://issues.apache.org/jira/browse/WICKET-950

Regards,
Sebastiaan

Chris Lintz wrote:
> Hi all,
> So i think there is a bug in IndexedParamUrlCodingStrategy .  I have this
> simple mount in my extened WebApplication:
> 
>    mount(new IndexedParamUrlCodingStrategy("/joinme",
> InviteAcceptancePage.class));
> 
> 
> In my InviteAcceptancePage class, i simply do this snippet of code:
> 
> public InviteAcceptancePage(PageParameters params)
> {
>    String code = params.getString("0");
>    logger.debug("code:"+code);
>    ...
> 
> }
> When i do this in my browser for example: 
> http://www.mydomain.com/joinme/55555
> 
> The following 55555 parameter is logged just fine, but after the constructor
> returns I get the below exception:
> 
> 22:23:43,600 ERROR [RequestCycle] Not all parameters were encoded. Make sure
> all parameter names are integers in consecutive order starting with zero.
> Current parameter names are: [wicket:interface]
> org.apache.wicket.WicketRuntimeException: Not all parameters were encoded.
> Make sure all parameter names are integers in consecutive order
> 
> 
> 
> Any ideas?
> 
> thanks