• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get user or username using principle, httpRequest

 
Farhad Rahmati
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys

I am new in JEE 6 and servlets. I have been trying to learn how to get an instance of a user and show his username roles. I know how to check if a user is in a role. but I couldn't get how to show the username. or at least an instance of itself.

Thank you

 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about calling getName() on the Principal object?
 
Farhad Rahmati
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much,
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!