This content has been marked as final.
Show 2 replies
-
1. Re: Know current login user in my bean
jaikiran Sep 28, 2006 3:14 AM (in response to yakamax)I havent worked with JSF, but how about this API:
http://java.sun.com/javaee/javaserverfaces/1.0/docs/api/javax/faces/context/ExternalContext.html#getRemoteUser()
So your code will look like:FacesContext fc = FacesContext.getCurrentInstance(); String loggedInUsername = fc.getExternalContext().getRemoteUser();
-
2. Re: Know current login user in my bean
yakamax Sep 28, 2006 3:19 AM (in response to yakamax)Thanks but i find this :
[CODE]
FacesContext context = FacesContext.getCurrentInstance();
Principal p = context.getExternalContext().getUserPrincipal();
String login = p.getName();
[/CODE]
Have Fun