• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletContext getting the name of the user that's logged in

 
Jeroen Nouws
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

i'm looking to get a username from a person that loggs in,
i heard you can get it from the servletContext, but don't know what method to look for
can anyone help me on my way?

cheers
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That greatly depends upon what you mean by "logged in".
 
Jeroen Nouws
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've found what i was looking for in the request.getRemoteUser();
with logging in i meant supplying a username and password to access a restricted area
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right -- which will only work if you use container-managed authentication (as it appears you are). Not everyone does, so it's important to point that out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic