You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Robin Shine (JIRA)" <ji...@apache.org> on 2014/03/28 10:26:15 UTC

[jira] [Commented] (WICKET-5546) Adding behavior in component instantiation listener causes Page.onInitialize() being called even if constructor throws an exception

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

Robin Shine commented on WICKET-5546:
-------------------------------------

This relates to WICKET-5387

> Adding behavior in component instantiation listener causes Page.onInitialize() being called even if constructor throws an exception
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5546
>                 URL: https://issues.apache.org/jira/browse/WICKET-5546
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.13.0, 6.14.0
>            Reporter: Robin Shine
>            Priority: Minor
>         Attachments: myproject.zip
>
>
> Page.onInitialize() will be called even if constructor throws an exception
> in case below code is added in wicket WebApplication.init():
> getComponentInstantiationListeners().add(new IComponentInstantiationListener() {
>               @Override
>               public void onInstantiation(Component component) {
>                   component.add(new Behavior() {
>                   });
>               }
>              
>           });
> It seems that the instantiation listener adds the behavior to the page at very start of the page constructor, and then the page is marked as dirty to cause onInitialize() being called afterwards.



--
This message was sent by Atlassian JIRA
(v6.2#6252)