[jboss-user] [JBoss Seam] - Re: Can i use another kind of architeture for a SEAM applica
Delphi's Ghost
do-not-reply at jboss.com
Fri May 4 21:37:47 EDT 2007
Hey Carlos
anonymous wrote :
| but when should i call the forwardToBaseAction() ??? In my Action constructor ??
As Christian said, the @Create annotation tells seam to call this function once the bean has been constructed.
If you use Christians method beware that when you call setEntity, you are still in the constructor, so therefore nothing has been injected yet. This could cause problems, i.e. if you have code in setEntity which writes to the @Logger, then the logger won't be injected yet.
You can get around it using the same syntax (something like Component.getInstance("org.jboss.seam.Logger")) but why use 2 methods of accessing components in your beans?
Personally, I always create a @Create annotated create method so I can write code in it that will be called only once all the items have been injected.
But hey, both will work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043389#4043389
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043389
More information about the jboss-user
mailing list