• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
 
Author and ninkuma
Marshal
Posts: 66690
167
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
Posts: 66690
167
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.
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!