You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Filip S. Adamsen (JIRA)" <de...@tapestry.apache.org> on 2008/08/17 14:09:44 UTC

[jira] Commented: (TAPESTRY-2598) Infinite loop when returning current page instance from onActivate using "this"

    [ https://issues.apache.org/jira/browse/TAPESTRY-2598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623185#action_12623185 ] 

Filip S. Adamsen commented on TAPESTRY-2598:
--------------------------------------------

What happens is that you're asking Tapestry to redirect to your page. When that happens, it's activated and again told to redirect to your page. An infinite loop at this point is expected.

That's why you have to return null. Perhaps this should be added to the docs?

> Infinite loop when returning current page instance from onActivate using "this"
> -------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2598
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2598
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 5.0.14
>            Reporter: Vjeran Marcinko
>
> This kind of activate handler goes into infinite loop:
> Object onActivate() {
>      System.out.println("This is looping infinitely ...");
>      return this;
>  }
> Returning "null" instead of "this" works OK. It's stated in docs that "null" should be used when wanting to direct to current page, but nevertheless, "this" shouldn't trigger infinite loop.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org