File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get HTTP Session username?

 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using FORM authentication under Tomcat 5. Everything works fine, but I'm trying to get the name of the logged in user, as it's stored in the session authentication. Is there a Principal, or Identity instance I can grab from the session in order to display the currently logged in user?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServletRequest has the getUserPrincipal and getRemoteUser methods, which return this information.
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect! Thanks a bunch!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic