cancel
Showing results for 
Search instead for 
Did you mean: 

get current user

ze
Champ in-the-making
Champ in-the-making
Hi,

I nedd to get the current user to my jsp (container.jsp) to write an log file..

wich bean i have to call?

I use this,

   LoginBean lb = new LoginBean();
   String userName = lb.getUsername();

   out.write("UserName "+userName);

   NavigationBean nb= new NavigationBean();
   String nb2 = nb.getCurrentNodeId();

   out.write("Current No:  "+nb2);

but the result cames nulll  :cry:

thanks in advance…
1 REPLY 1

kevinr
Star Contributor
Star Contributor
The beans you are trying to use are JSF managed beans - you cannot just 'new' them up - you need to ask the JSF framework for an instance of the bean. I suggest you do some reading up on JSF Tutorials on the web and it will then make sense Smiley Happy

Thanks,

Kevin