2010-11-08 61 views

回答

5

由于大多数事件键(类型)被声明为public static final(作为您引用的那个),因此您可以引用它们而不会产生拼写错误。

@Observer(Identity.EVENT_NOT_LOGGED_IN) 
public void handleNotLoggedIn() { 
} 

不幸的是,你不能事件类型声明中component.xml使用EL。我最近尝试过。

<event type="#{...}"> 
    <!-- does not work --> 
</event> 

有,恕我直言,没有其他的办法不是复制和粘贴的事件钥匙进入component.xml防止拼写错误。

+0

非常感谢你,kraftan,这正是我想要的。 – 2010-11-09 03:22:34

相关问题