Quantcast

Requests being dispatched in an infinite loop

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Requests being dispatched in an infinite loop

swaroop belur
Hi all

Wicket version 1.2.4

I have this piece of code which is apparently causing wicket to send the requests in an infinite loop


<code>

This code is present in a class called EditConfig. When I click on the link basically
all it does is to refresh the page by creating a new instance of page.


             new Link("refresh") {

                        @Override
                        public void onClick() {
                                setResponsePage(EditConfig.class);
                        }

                }
</code>

Apparently setResponsePage(EditConfig.class) causes the request target to be a bookmarkable one
and the setting on respond method is to redirect the browser to the url generated by the target-
which then again causes the event  method to be processed - i.e in this case page object to be created
again

Why would wicket want to  keep redirecting . If after the page object has
been created , i thought it would render the page as is.

Am i missing something over here?

thanks
swaroop belur
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Requests being dispatched in an infinite loop

Eelco Hillenius
No idea. Do you get the same thing when you use the latest 1.2.x version?

Eelco

On 9/10/07, swaroop belur <[hidden email]> wrote:

>
> Hi all
>
> Wicket version 1.2.4
>
> I have this piece of code which is apparently causing wicket to send the
> requests in an infinite loop
>
>
> <code>
>
> This code is present in a class called EditConfig. When I click on the link
> basically
> all it does is to refresh the page by creating a new instance of page.
>
>
>              new Link("refresh") {
>
>                         @Override
>                         public void onClick() {
>                                 setResponsePage(EditConfig.class);
>                         }
>
>                 }
> </code>
>
> Apparently setResponsePage(EditConfig.class) causes the request target to be
> a bookmarkable one
> and the setting on respond method is to redirect the browser to the url
> generated by the target-
> which then again causes the event  method to be processed - i.e in this case
> page object to be created
> again
>
> Why would wicket want to  keep redirecting . If after the page object has
> been created , i thought it would render the page as is.
>
> Am i missing something over here?
>
> thanks
> swaroop belur
> --
> View this message in context: http://www.nabble.com/Requests-being-dispatched-in-an-infinite-loop-tf4420388.html#a12608388
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Requests being dispatched in an infinite loop

swaroop belur
Hi Eelco ,

It was all  my fault . It was a typo on my side. Instead of typing
component.setRequired(true) ; , I  selected component.setRedirect
from the IDE auto completion menu.

As a result, it was always redirecting... My fault..I guess i didnt
see what i selected from the ide popup menu.

Thanks anyway...

BUT one question : Do you think setRedirect should really be
in Component class.

-swaroop


On 9/25/07, Eelco Hillenius <[hidden email]> wrote:

>
> No idea. Do you get the same thing when you use the latest 1.2.x version?
>
> Eelco
>
> On 9/10/07, swaroop belur <[hidden email]> wrote:
> >
> > Hi all
> >
> > Wicket version 1.2.4
> >
> > I have this piece of code which is apparently causing wicket to send the
> > requests in an infinite loop
> >
> >
> > <code>
> >
> > This code is present in a class called EditConfig. When I click on the
> link
> > basically
> > all it does is to refresh the page by creating a new instance of page.
> >
> >
> >              new Link("refresh") {
> >
> >                         @Override
> >                         public void onClick() {
> >                                 setResponsePage(EditConfig.class);
> >                         }
> >
> >                 }
> > </code>
> >
> > Apparently setResponsePage(EditConfig.class) causes the request target
> to be
> > a bookmarkable one
> > and the setting on respond method is to redirect the browser to the url
> > generated by the target-
> > which then again causes the event  method to be processed - i.e in this
> case
> > page object to be created
> > again
> >
> > Why would wicket want to  keep redirecting . If after the page object
> has
> > been created , i thought it would render the page as is.
> >
> > Am i missing something over here?
> >
> > thanks
> > swaroop belur
> > --
> > View this message in context:
> http://www.nabble.com/Requests-being-dispatched-in-an-infinite-loop-tf4420388.html#a12608388
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Requests being dispatched in an infinite loop

Eelco Hillenius
> BUT one question : Do you think setRedirect should really be
> in Component class.

No. It's one of these things that if it were up to me would never have
been in there. But it's probably a bit late in the game to get rid of
it now.

EElco

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...