You could specify a managed-property that will inject the string user--
#{facesContext.externalContext.remoteUser}
The problem with @PostConstruct is that it happens before property injection. So you could put that code, accessing the FacesContext directly into your backingbean.
To Roger/Ed/Ryan-- I guess the spec is silent on when the @PostConstruct happens exactly. Would it be better to have this happen post injection, otherwise the @PostConstruct gains nothing over putting logic in the default constructor. At least post property injection, the @PostConstruct method would be able to use/process on injected logic.
It'd be nice to inject a user or a request parameter, then basically have the @PostConstruct work like an Action's execute method, but done within the ManagedBean facility.
I'll double check with Gavin/Seam to see when they invoke these methods within the injection process.
-- Jacob
Roger wrote:
===============================
Hi Chris -
Also, take into account Ryan's follow email about the annotations if
you're using jsf 1.2.
Thanks, Roger.
ChrisC_at_Dive100.Freeserve.co.uk wrote:
>It works - thanks - must have misread something
>
>
>
>
>>Why do you say backing beans (managed beans) do not have a constructor?
>>They are just POJO's, and you should be able to do the initialization.
>>
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net