You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Doug Donohoe <do...@donohoe.info> on 2008/05/18 17:26:55 UTC

Bookmarkable / Stateless form submit bug (eelco - need your advice)

I'm tracking down a bug where a stateless form submission isn't working if I
reboot my tomcat server.  The issue is that Wicket doesn't recognize the
wicket:interface parameter that is passed down.

I believe I've tracked down the problem to this code in
BookmarkablePageRequestTargetUrlCodingStrategy:

		// do some extra work for checking whether this is a normal request to a
		// bookmarkable page, or a request to a stateless page (in which case a
		// wicket:interface parameter should be available
		final String interfaceParameter = (String)parameters
				.remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);

		if (interfaceParameter != null)
		{
			WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
requestParameters);
			return new BookmarkableListenerInterfaceRequestTarget(pageMapName,
					(Class)bookmarkablePageClassRef.get(), parameters, requestParameters
							.getComponentPath(), requestParameters.getInterfaceName(),
					requestParameters.getVersionNumber());
		}


The issue is that the 'parameters' will never contain the
INTERFACE_PARAMETER_NAME because it would have been removed in
WebRequestCodingStrategy:decode:215 which as far as I can tell is always
called first (from RequestCycle.step.RESOLVE_TARGET:1233).

The 'requestParameters' should already have the interface parameters, so it
isn't clear why the addInterfaceParameters() logic is being called again (it
is already called in WebRequestCodingStrategy:decode:200).

In what case was this logic necessary?  Being new to the code base, I don't
know every possible code path, so perhaps there is a different way of
getting to this point that I'm not seeing.

-Doug





-- 
View this message in context: http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17304155.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Johan Compagner <jc...@gmail.com>.
I think i wrote that stateless stuff, dont know exactly that it is al my code.
I guess looking at svn history will give tha answer

On 5/19/08, Eelco Hillenius <ee...@gmail.com> wrote:
>> Basically, it depends on what Eelco was thinking when he originally wrote
>> this.
>
> I have no idea, it's quite a while ago :-) Oh, and are you sure I
> wrote it to start with? There are plenty of files with my author tag
> that weren't written by me (or only the initial versions)...
>
> Eelco
>

Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Eelco Hillenius <ee...@gmail.com>.
> thats back from the day when eelco used to go around and claim all
> files that did not have @author for himself so he could impress girls.

Yeah. Too bad it didn't work. I found out that switching deodorants
worked better.

Eelco

Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Igor Vaynberg <ig...@gmail.com>.
On Sun, May 18, 2008 at 3:18 PM, Eelco Hillenius
<ee...@gmail.com> wrote:
> Oh, and are you sure I
> wrote it to start with? There are plenty of files with my author tag
> that weren't written by me

thats back from the day when eelco used to go around and claim all
files that did not have @author for himself so he could impress girls.

-igor



(or only the initial versions)...
>
> Eelco
>

Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Eelco Hillenius <ee...@gmail.com>.
> Basically, it depends on what Eelco was thinking when he originally wrote
> this.

I have no idea, it's quite a while ago :-) Oh, and are you sure I
wrote it to start with? There are plenty of files with my author tag
that weren't written by me (or only the initial versions)...

Eelco

Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Doug Donohoe <do...@donohoe.info>.
I think I know what is going on here.  Eelco's case is for when the interface
is not in the query string.  For example:

/sample/stateless/wicket:interface/:0:statelessform::IFormSubmitListener::/

His logic is necessary because the mount decoding logic happens after the
core wicket query string / form post processing logic.  This raises the
question of why this is the case.  It seems that the mount page logic was
added on after and this was done to make it work.

I think this bug was missed because none of the test cases in
StatelessStatefullUrlCodingStrategyTest execute the stateless form case
where the submission is the first encounter with the page.  Instead, each
page is generated and then submitted meaning the page is found in the cache.

I found the bug testing when the session was deleted (by rebooting Tomcat).

Anyhow, I think my patch is correct, although some thought may need to be
given to the two locations for  parameter parsing.

-Doug


Doug Donohoe wrote:
> 
> Note that if Johan is correct that the wicket interface will never be
> there then this logic (rewritten and as it appears in my patch) can be
> removed:
> 
>         // the page map name should be defined already by logic done in
>         // WebRequestCodingStrategy.decode(), but if not there, check
>         // parameters.  We always remove the interface parameter just in
> case.
>         String pageMapNameEncoded =
> (String)parameters.remove(WebRequestCodingStrategy.PAGEMAP);
> 		if (requestParameters.getPageMapName() == null)
> 		{
> 			requestParameters.setPageMapName(pageMapNameEncoded);
> 		}
> 
>         // the interface should be defined already by logic done in
>         // WebRequestCodingStrategy.decode(), but if not there, check
>         // parameters.  We always remove the pagemap parameter just in
> case.
>         String interfaceParameter =
> (String)parameters.remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
>         if (requestParameters.getInterfaceName() == null)
>         {
>            
> WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
> requestParameters);
>         }
> 
> Basically, it depends on what Eelco was thinking when he originally wrote
> this.
> 

-- 
View this message in context: http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17308130.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Doug Donohoe <do...@donohoe.info>.
Note that if Johan is correct that the wicket interface will never be there
then this logic (rewritten and as it appears in my patch) can be removed:

        // the page map name should be defined already by logic done in
        // WebRequestCodingStrategy.decode(), but if not there, check
        // parameters.  We always remove the interface parameter just in
case.
        String pageMapNameEncoded =
(String)parameters.remove(WebRequestCodingStrategy.PAGEMAP);
		if (requestParameters.getPageMapName() == null)
		{
			requestParameters.setPageMapName(pageMapNameEncoded);
		}

        // the interface should be defined already by logic done in
        // WebRequestCodingStrategy.decode(), but if not there, check
        // parameters.  We always remove the pagemap parameter just in case.
        String interfaceParameter =
(String)parameters.remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
        if (requestParameters.getInterfaceName() == null)
        {
           
WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
requestParameters);
        }

Basically, it depends on what Eelco was thinking when he originally wrote
this.
-- 
View this message in context: http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17307885.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Doug Donohoe <do...@donohoe.info>.
I posted a bug and patch

https://issues.apache.org/jira/browse/WICKET-1643


Doug Donohoe wrote:
> 
> The BookmarkablePageRequestTargetUrlCodingStrategy needs it so this code
> is run:
> 
> 			return new BookmarkableListenerInterfaceRequestTarget(pageMapName,
> 					(Class)bookmarkablePageClassRef.get(), parameters, requestParameters
> 							.getComponentPath(), requestParameters.getInterfaceName(),
> 					requestParameters.getVersionNumber());
> 
> Otherwise my form's onSubmit method is not called because the interface
> isn't recognized.
> 
> I've already fixed the code and I'll submit a patch.
> 
> -Doug
> 
> 
> Johan Compagner wrote:
>> 
>> i dont get what is the problem at your place
>> At that time the wicket interface should be removed
>> else the page parameters has wicket params in it that shouldnt be those
>> dont
>> belong to user params.
>> 
>> but why is this a problem?
>> 
>> Why do you need that param later on?
>> 
>> johan
>> 
>> 
>> On Sun, May 18, 2008 at 5:26 PM, Doug Donohoe <do...@donohoe.info> wrote:
>> 
>>>
>>> I'm tracking down a bug where a stateless form submission isn't working
>>> if
>>> I
>>> reboot my tomcat server.  The issue is that Wicket doesn't recognize the
>>> wicket:interface parameter that is passed down.
>>>
>>> I believe I've tracked down the problem to this code in
>>> BookmarkablePageRequestTargetUrlCodingStrategy:
>>>
>>>                // do some extra work for checking whether this is a
>>> normal
>>> request to a
>>>                // bookmarkable page, or a request to a stateless page
>>> (in
>>> which case a
>>>                // wicket:interface parameter should be available
>>>                final String interfaceParameter = (String)parameters
>>>
>>>  .remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
>>>
>>>                if (interfaceParameter != null)
>>>                {
>>>
>>>  WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
>>> requestParameters);
>>>                        return new
>>> BookmarkableListenerInterfaceRequestTarget(pageMapName,
>>>
>>>  (Class)bookmarkablePageClassRef.get(), parameters, requestParameters
>>>                                                       
>>> .getComponentPath(),
>>> requestParameters.getInterfaceName(),
>>>
>>>  requestParameters.getVersionNumber());
>>>                }
>>>
>>>
>>> The issue is that the 'parameters' will never contain the
>>> INTERFACE_PARAMETER_NAME because it would have been removed in
>>> WebRequestCodingStrategy:decode:215 which as far as I can tell is always
>>> called first (from RequestCycle.step.RESOLVE_TARGET:1233).
>>>
>>> The 'requestParameters' should already have the interface parameters, so
>>> it
>>> isn't clear why the addInterfaceParameters() logic is being called again
>>> (it
>>> is already called in WebRequestCodingStrategy:decode:200).
>>>
>>> In what case was this logic necessary?  Being new to the code base, I
>>> don't
>>> know every possible code path, so perhaps there is a different way of
>>> getting to this point that I'm not seeing.
>>>
>>> -Doug
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17304155.html
>>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17307258.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Doug Donohoe <do...@donohoe.info>.
This particular change is relatively simple.  I modified the code to take
into account both possible scenarios:

1) wicket:interface passed in via query string
2) wicket:interface passed in via path parameters (as is done for several of
the mount strategies)

Prior to my fix, #1 was not taken into account which caused the bug I'm
seeing.

Essentially what happens now is that if the wicket:interface is not found
already, it then looks in parameters passed in #2 style.

-Doug


Johan Compagner wrote:
> 
> i just need to look at it a bit more
> because that wicket:interface parameter cant go into the bookmarkable page
> constructor
> that is just a big no no.. As long as that doesnt happen i dont mind to
> much.
> 
> johan
> 
> 
> On Mon, May 19, 2008 at 3:56 PM, Doug Donohoe <do...@donohoe.info> wrote:
> 
>>
>> The patch fixed the problem I was seeing.
>>
>> I'm not sure how to create a good test case for this.  The WicketTester
>> doesn't seem to replicate the behavior of a browser quite properly.  The
>> existing test cases could use some improvement because they obviously
>> missed
>> this.
>>
>> It took me about 4 hours to step through the code and learn what was
>> going
>> on.  I'm confident it resolves the issue I was seeing and that it retains
>> the old behavior for the case when the wicket interface is passed through
>> the path params.
>>
>>
>> Johan Compagner wrote:
>> >
>> > I will look at that patch but it is weird, it shouldnt be needed that
>> > that is in the page param, because the special
>> > BookmarkabkleInterfaceRequestTarget already does have all the needed
>> > info
>> >
>> > On 5/18/08, Doug Donohoe <do...@donohoe.info> wrote:
>> >>
>> >> The BookmarkablePageRequestTargetUrlCodingStrategy needs it so this
>> code
>> >> is
>> >> run:
>> >>
>> >>                      return new
>> BookmarkableListenerInterfaceRequestTarget(pageMapName,
>> >>
>>  (Class)bookmarkablePageClassRef.get(), parameters, requestParameters
>> >>
>>  .getComponentPath(), requestParameters.getInterfaceName(),
>> >>
>>  requestParameters.getVersionNumber());
>> >>
>> >> Otherwise my form's onSubmit method is not called because the
>> interface
>> >> isn't recognized.
>> >>
>> >> I've already fixed the code and I'll submit a patch.
>> >>
>> >> -Doug
>> >>
>> >>
>> >> Johan Compagner wrote:
>> >>>
>> >>> i dont get what is the problem at your place
>> >>> At that time the wicket interface should be removed
>> >>> else the page parameters has wicket params in it that shouldnt be
>> those
>> >>> dont
>> >>> belong to user params.
>> >>>
>> >>> but why is this a problem?
>> >>>
>> >>> Why do you need that param later on?
>> >>>
>> >>> johan
>> >>>
>> >>>
>> >>> On Sun, May 18, 2008 at 5:26 PM, Doug Donohoe <do...@donohoe.info>
>> wrote:
>> >>>
>> >>>>
>> >>>> I'm tracking down a bug where a stateless form submission isn't
>> working
>> >>>> if
>> >>>> I
>> >>>> reboot my tomcat server.  The issue is that Wicket doesn't recognize
>> >>>> the
>> >>>> wicket:interface parameter that is passed down.
>> >>>>
>> >>>> I believe I've tracked down the problem to this code in
>> >>>> BookmarkablePageRequestTargetUrlCodingStrategy:
>> >>>>
>> >>>>                // do some extra work for checking whether this is a
>> >>>> normal
>> >>>> request to a
>> >>>>                // bookmarkable page, or a request to a stateless
>> page
>> >>>> (in
>> >>>> which case a
>> >>>>                // wicket:interface parameter should be available
>> >>>>                final String interfaceParameter = (String)parameters
>> >>>>
>> >>>>  .remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
>> >>>>
>> >>>>                if (interfaceParameter != null)
>> >>>>                {
>> >>>>
>> >>>>  WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
>> >>>> requestParameters);
>> >>>>                        return new
>> >>>> BookmarkableListenerInterfaceRequestTarget(pageMapName,
>> >>>>
>> >>>>  (Class)bookmarkablePageClassRef.get(), parameters,
>> requestParameters
>> >>>>
>> >>>> .getComponentPath(),
>> >>>> requestParameters.getInterfaceName(),
>> >>>>
>> >>>>  requestParameters.getVersionNumber());
>> >>>>                }
>> >>>>
>> >>>>
>> >>>> The issue is that the 'parameters' will never contain the
>> >>>> INTERFACE_PARAMETER_NAME because it would have been removed in
>> >>>> WebRequestCodingStrategy:decode:215 which as far as I can tell is
>> >>>> always
>> >>>> called first (from RequestCycle.step.RESOLVE_TARGET:1233).
>> >>>>
>> >>>> The 'requestParameters' should already have the interface
>> parameters,
>> >>>> so
>> >>>> it
>> >>>> isn't clear why the addInterfaceParameters() logic is being called
>> >>>> again
>> >>>> (it
>> >>>> is already called in WebRequestCodingStrategy:decode:200).
>> >>>>
>> >>>> In what case was this logic necessary?  Being new to the code base,
>> I
>> >>>> don't
>> >>>> know every possible code path, so perhaps there is a different way
>> of
>> >>>> getting to this point that I'm not seeing.
>> >>>>
>> >>>> -Doug
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> View this message in context:
>> >>>>
>> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17304155.html
>> >>>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17306650.html
>> >> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17316713.html
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17322227.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Johan Compagner <jc...@gmail.com>.
i just need to look at it a bit more
because that wicket:interface parameter cant go into the bookmarkable page
constructor
that is just a big no no.. As long as that doesnt happen i dont mind to
much.

johan


On Mon, May 19, 2008 at 3:56 PM, Doug Donohoe <do...@donohoe.info> wrote:

>
> The patch fixed the problem I was seeing.
>
> I'm not sure how to create a good test case for this.  The WicketTester
> doesn't seem to replicate the behavior of a browser quite properly.  The
> existing test cases could use some improvement because they obviously
> missed
> this.
>
> It took me about 4 hours to step through the code and learn what was going
> on.  I'm confident it resolves the issue I was seeing and that it retains
> the old behavior for the case when the wicket interface is passed through
> the path params.
>
>
> Johan Compagner wrote:
> >
> > I will look at that patch but it is weird, it shouldnt be needed that
> > that is in the page param, because the special
> > BookmarkabkleInterfaceRequestTarget already does have all the needed
> > info
> >
> > On 5/18/08, Doug Donohoe <do...@donohoe.info> wrote:
> >>
> >> The BookmarkablePageRequestTargetUrlCodingStrategy needs it so this code
> >> is
> >> run:
> >>
> >>                      return new
> BookmarkableListenerInterfaceRequestTarget(pageMapName,
> >>
>  (Class)bookmarkablePageClassRef.get(), parameters, requestParameters
> >>
>  .getComponentPath(), requestParameters.getInterfaceName(),
> >>
>  requestParameters.getVersionNumber());
> >>
> >> Otherwise my form's onSubmit method is not called because the interface
> >> isn't recognized.
> >>
> >> I've already fixed the code and I'll submit a patch.
> >>
> >> -Doug
> >>
> >>
> >> Johan Compagner wrote:
> >>>
> >>> i dont get what is the problem at your place
> >>> At that time the wicket interface should be removed
> >>> else the page parameters has wicket params in it that shouldnt be those
> >>> dont
> >>> belong to user params.
> >>>
> >>> but why is this a problem?
> >>>
> >>> Why do you need that param later on?
> >>>
> >>> johan
> >>>
> >>>
> >>> On Sun, May 18, 2008 at 5:26 PM, Doug Donohoe <do...@donohoe.info>
> wrote:
> >>>
> >>>>
> >>>> I'm tracking down a bug where a stateless form submission isn't
> working
> >>>> if
> >>>> I
> >>>> reboot my tomcat server.  The issue is that Wicket doesn't recognize
> >>>> the
> >>>> wicket:interface parameter that is passed down.
> >>>>
> >>>> I believe I've tracked down the problem to this code in
> >>>> BookmarkablePageRequestTargetUrlCodingStrategy:
> >>>>
> >>>>                // do some extra work for checking whether this is a
> >>>> normal
> >>>> request to a
> >>>>                // bookmarkable page, or a request to a stateless page
> >>>> (in
> >>>> which case a
> >>>>                // wicket:interface parameter should be available
> >>>>                final String interfaceParameter = (String)parameters
> >>>>
> >>>>  .remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
> >>>>
> >>>>                if (interfaceParameter != null)
> >>>>                {
> >>>>
> >>>>  WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
> >>>> requestParameters);
> >>>>                        return new
> >>>> BookmarkableListenerInterfaceRequestTarget(pageMapName,
> >>>>
> >>>>  (Class)bookmarkablePageClassRef.get(), parameters, requestParameters
> >>>>
> >>>> .getComponentPath(),
> >>>> requestParameters.getInterfaceName(),
> >>>>
> >>>>  requestParameters.getVersionNumber());
> >>>>                }
> >>>>
> >>>>
> >>>> The issue is that the 'parameters' will never contain the
> >>>> INTERFACE_PARAMETER_NAME because it would have been removed in
> >>>> WebRequestCodingStrategy:decode:215 which as far as I can tell is
> >>>> always
> >>>> called first (from RequestCycle.step.RESOLVE_TARGET:1233).
> >>>>
> >>>> The 'requestParameters' should already have the interface parameters,
> >>>> so
> >>>> it
> >>>> isn't clear why the addInterfaceParameters() logic is being called
> >>>> again
> >>>> (it
> >>>> is already called in WebRequestCodingStrategy:decode:200).
> >>>>
> >>>> In what case was this logic necessary?  Being new to the code base, I
> >>>> don't
> >>>> know every possible code path, so perhaps there is a different way of
> >>>> getting to this point that I'm not seeing.
> >>>>
> >>>> -Doug
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17304155.html
> >>>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >>>>
> >>>>
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17306650.html
> >> Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17316713.html
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>

Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Doug Donohoe <do...@donohoe.info>.
The patch fixed the problem I was seeing.  

I'm not sure how to create a good test case for this.  The WicketTester
doesn't seem to replicate the behavior of a browser quite properly.  The
existing test cases could use some improvement because they obviously missed
this.  

It took me about 4 hours to step through the code and learn what was going
on.  I'm confident it resolves the issue I was seeing and that it retains
the old behavior for the case when the wicket interface is passed through
the path params.  


Johan Compagner wrote:
> 
> I will look at that patch but it is weird, it shouldnt be needed that
> that is in the page param, because the special
> BookmarkabkleInterfaceRequestTarget already does have all the needed
> info
> 
> On 5/18/08, Doug Donohoe <do...@donohoe.info> wrote:
>>
>> The BookmarkablePageRequestTargetUrlCodingStrategy needs it so this code
>> is
>> run:
>>
>> 			return new BookmarkableListenerInterfaceRequestTarget(pageMapName,
>> 					(Class)bookmarkablePageClassRef.get(), parameters, requestParameters
>> 							.getComponentPath(), requestParameters.getInterfaceName(),
>> 					requestParameters.getVersionNumber());
>>
>> Otherwise my form's onSubmit method is not called because the interface
>> isn't recognized.
>>
>> I've already fixed the code and I'll submit a patch.
>>
>> -Doug
>>
>>
>> Johan Compagner wrote:
>>>
>>> i dont get what is the problem at your place
>>> At that time the wicket interface should be removed
>>> else the page parameters has wicket params in it that shouldnt be those
>>> dont
>>> belong to user params.
>>>
>>> but why is this a problem?
>>>
>>> Why do you need that param later on?
>>>
>>> johan
>>>
>>>
>>> On Sun, May 18, 2008 at 5:26 PM, Doug Donohoe <do...@donohoe.info> wrote:
>>>
>>>>
>>>> I'm tracking down a bug where a stateless form submission isn't working
>>>> if
>>>> I
>>>> reboot my tomcat server.  The issue is that Wicket doesn't recognize
>>>> the
>>>> wicket:interface parameter that is passed down.
>>>>
>>>> I believe I've tracked down the problem to this code in
>>>> BookmarkablePageRequestTargetUrlCodingStrategy:
>>>>
>>>>                // do some extra work for checking whether this is a
>>>> normal
>>>> request to a
>>>>                // bookmarkable page, or a request to a stateless page
>>>> (in
>>>> which case a
>>>>                // wicket:interface parameter should be available
>>>>                final String interfaceParameter = (String)parameters
>>>>
>>>>  .remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
>>>>
>>>>                if (interfaceParameter != null)
>>>>                {
>>>>
>>>>  WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
>>>> requestParameters);
>>>>                        return new
>>>> BookmarkableListenerInterfaceRequestTarget(pageMapName,
>>>>
>>>>  (Class)bookmarkablePageClassRef.get(), parameters, requestParameters
>>>>
>>>> .getComponentPath(),
>>>> requestParameters.getInterfaceName(),
>>>>
>>>>  requestParameters.getVersionNumber());
>>>>                }
>>>>
>>>>
>>>> The issue is that the 'parameters' will never contain the
>>>> INTERFACE_PARAMETER_NAME because it would have been removed in
>>>> WebRequestCodingStrategy:decode:215 which as far as I can tell is
>>>> always
>>>> called first (from RequestCycle.step.RESOLVE_TARGET:1233).
>>>>
>>>> The 'requestParameters' should already have the interface parameters,
>>>> so
>>>> it
>>>> isn't clear why the addInterfaceParameters() logic is being called
>>>> again
>>>> (it
>>>> is already called in WebRequestCodingStrategy:decode:200).
>>>>
>>>> In what case was this logic necessary?  Being new to the code base, I
>>>> don't
>>>> know every possible code path, so perhaps there is a different way of
>>>> getting to this point that I'm not seeing.
>>>>
>>>> -Doug
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17304155.html
>>>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17306650.html
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17316713.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Johan Compagner <jc...@gmail.com>.
I will look at that patch but it is weird, it shouldnt be needed that
that is in the page param, because the special
BookmarkabkleInterfaceRequestTarget already does have all the needed
info

On 5/18/08, Doug Donohoe <do...@donohoe.info> wrote:
>
> The BookmarkablePageRequestTargetUrlCodingStrategy needs it so this code is
> run:
>
> 			return new BookmarkableListenerInterfaceRequestTarget(pageMapName,
> 					(Class)bookmarkablePageClassRef.get(), parameters, requestParameters
> 							.getComponentPath(), requestParameters.getInterfaceName(),
> 					requestParameters.getVersionNumber());
>
> Otherwise my form's onSubmit method is not called because the interface
> isn't recognized.
>
> I've already fixed the code and I'll submit a patch.
>
> -Doug
>
>
> Johan Compagner wrote:
>>
>> i dont get what is the problem at your place
>> At that time the wicket interface should be removed
>> else the page parameters has wicket params in it that shouldnt be those
>> dont
>> belong to user params.
>>
>> but why is this a problem?
>>
>> Why do you need that param later on?
>>
>> johan
>>
>>
>> On Sun, May 18, 2008 at 5:26 PM, Doug Donohoe <do...@donohoe.info> wrote:
>>
>>>
>>> I'm tracking down a bug where a stateless form submission isn't working
>>> if
>>> I
>>> reboot my tomcat server.  The issue is that Wicket doesn't recognize the
>>> wicket:interface parameter that is passed down.
>>>
>>> I believe I've tracked down the problem to this code in
>>> BookmarkablePageRequestTargetUrlCodingStrategy:
>>>
>>>                // do some extra work for checking whether this is a
>>> normal
>>> request to a
>>>                // bookmarkable page, or a request to a stateless page (in
>>> which case a
>>>                // wicket:interface parameter should be available
>>>                final String interfaceParameter = (String)parameters
>>>
>>>  .remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
>>>
>>>                if (interfaceParameter != null)
>>>                {
>>>
>>>  WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
>>> requestParameters);
>>>                        return new
>>> BookmarkableListenerInterfaceRequestTarget(pageMapName,
>>>
>>>  (Class)bookmarkablePageClassRef.get(), parameters, requestParameters
>>>
>>> .getComponentPath(),
>>> requestParameters.getInterfaceName(),
>>>
>>>  requestParameters.getVersionNumber());
>>>                }
>>>
>>>
>>> The issue is that the 'parameters' will never contain the
>>> INTERFACE_PARAMETER_NAME because it would have been removed in
>>> WebRequestCodingStrategy:decode:215 which as far as I can tell is always
>>> called first (from RequestCycle.step.RESOLVE_TARGET:1233).
>>>
>>> The 'requestParameters' should already have the interface parameters, so
>>> it
>>> isn't clear why the addInterfaceParameters() logic is being called again
>>> (it
>>> is already called in WebRequestCodingStrategy:decode:200).
>>>
>>> In what case was this logic necessary?  Being new to the code base, I
>>> don't
>>> know every possible code path, so perhaps there is a different way of
>>> getting to this point that I'm not seeing.
>>>
>>> -Doug
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17304155.html
>>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17306650.html
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>

Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Doug Donohoe <do...@donohoe.info>.
The BookmarkablePageRequestTargetUrlCodingStrategy needs it so this code is
run:

			return new BookmarkableListenerInterfaceRequestTarget(pageMapName,
					(Class)bookmarkablePageClassRef.get(), parameters, requestParameters
							.getComponentPath(), requestParameters.getInterfaceName(),
					requestParameters.getVersionNumber());

Otherwise my form's onSubmit method is not called because the interface
isn't recognized.

I've already fixed the code and I'll submit a patch.

-Doug


Johan Compagner wrote:
> 
> i dont get what is the problem at your place
> At that time the wicket interface should be removed
> else the page parameters has wicket params in it that shouldnt be those
> dont
> belong to user params.
> 
> but why is this a problem?
> 
> Why do you need that param later on?
> 
> johan
> 
> 
> On Sun, May 18, 2008 at 5:26 PM, Doug Donohoe <do...@donohoe.info> wrote:
> 
>>
>> I'm tracking down a bug where a stateless form submission isn't working
>> if
>> I
>> reboot my tomcat server.  The issue is that Wicket doesn't recognize the
>> wicket:interface parameter that is passed down.
>>
>> I believe I've tracked down the problem to this code in
>> BookmarkablePageRequestTargetUrlCodingStrategy:
>>
>>                // do some extra work for checking whether this is a
>> normal
>> request to a
>>                // bookmarkable page, or a request to a stateless page (in
>> which case a
>>                // wicket:interface parameter should be available
>>                final String interfaceParameter = (String)parameters
>>
>>  .remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
>>
>>                if (interfaceParameter != null)
>>                {
>>
>>  WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
>> requestParameters);
>>                        return new
>> BookmarkableListenerInterfaceRequestTarget(pageMapName,
>>
>>  (Class)bookmarkablePageClassRef.get(), parameters, requestParameters
>>                                                       
>> .getComponentPath(),
>> requestParameters.getInterfaceName(),
>>
>>  requestParameters.getVersionNumber());
>>                }
>>
>>
>> The issue is that the 'parameters' will never contain the
>> INTERFACE_PARAMETER_NAME because it would have been removed in
>> WebRequestCodingStrategy:decode:215 which as far as I can tell is always
>> called first (from RequestCycle.step.RESOLVE_TARGET:1233).
>>
>> The 'requestParameters' should already have the interface parameters, so
>> it
>> isn't clear why the addInterfaceParameters() logic is being called again
>> (it
>> is already called in WebRequestCodingStrategy:decode:200).
>>
>> In what case was this logic necessary?  Being new to the code base, I
>> don't
>> know every possible code path, so perhaps there is a different way of
>> getting to this point that I'm not seeing.
>>
>> -Doug
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17304155.html
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17306650.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Bookmarkable / Stateless form submit bug (eelco - need your advice)

Posted by Johan Compagner <jc...@gmail.com>.
i dont get what is the problem at your place
At that time the wicket interface should be removed
else the page parameters has wicket params in it that shouldnt be those dont
belong to user params.

but why is this a problem?

Why do you need that param later on?

johan


On Sun, May 18, 2008 at 5:26 PM, Doug Donohoe <do...@donohoe.info> wrote:

>
> I'm tracking down a bug where a stateless form submission isn't working if
> I
> reboot my tomcat server.  The issue is that Wicket doesn't recognize the
> wicket:interface parameter that is passed down.
>
> I believe I've tracked down the problem to this code in
> BookmarkablePageRequestTargetUrlCodingStrategy:
>
>                // do some extra work for checking whether this is a normal
> request to a
>                // bookmarkable page, or a request to a stateless page (in
> which case a
>                // wicket:interface parameter should be available
>                final String interfaceParameter = (String)parameters
>
>  .remove(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME);
>
>                if (interfaceParameter != null)
>                {
>
>  WebRequestCodingStrategy.addInterfaceParameters(interfaceParameter,
> requestParameters);
>                        return new
> BookmarkableListenerInterfaceRequestTarget(pageMapName,
>
>  (Class)bookmarkablePageClassRef.get(), parameters, requestParameters
>                                                        .getComponentPath(),
> requestParameters.getInterfaceName(),
>
>  requestParameters.getVersionNumber());
>                }
>
>
> The issue is that the 'parameters' will never contain the
> INTERFACE_PARAMETER_NAME because it would have been removed in
> WebRequestCodingStrategy:decode:215 which as far as I can tell is always
> called first (from RequestCycle.step.RESOLVE_TARGET:1233).
>
> The 'requestParameters' should already have the interface parameters, so it
> isn't clear why the addInterfaceParameters() logic is being called again
> (it
> is already called in WebRequestCodingStrategy:decode:200).
>
> In what case was this logic necessary?  Being new to the code base, I don't
> know every possible code path, so perhaps there is a different way of
> getting to this point that I'm not seeing.
>
> -Doug
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Bookmarkable---Stateless-form-submit-bug-%28eelco---need-your-advice%29-tp17304155p17304155.html
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>