This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes How to get username after login with FORM based authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to get username after login with FORM based authentication" Watch "How to get username after login with FORM based authentication" New topic
Author

How to get username after login with FORM based authentication

K DeLucia
Ranch Hand

Joined: Apr 11, 2008
Posts: 68
I have an application that uses Tomcat FORM based authentication. I'm able to login successfully, but I don't know how to get the username. I'm having users log in with their email address and on the page they are redirected to (request.jsp), I want to capture the email address they entered so I can display it, and use it in the servlet that runs when that request.jsp form is submitted.

Any pointers on how to achieve this would be appreciated. Thanks!
Javid Jamae
Author
Ranch Hand

Joined: May 14, 2008
Posts: 198
The Servlet API provides the following methods on HttpServletRequest:



Author: JBoss in Action, javidjamae.com, @javidjamae on Twitter
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
public String getRemoteUser();

is also helpful.


Ping & DNS - my free Android networking tools app
K DeLucia
Ranch Hand

Joined: Apr 11, 2008
Posts: 68
Thanks. That's just what I need. I'll see if I can get it working!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get username after login with FORM based authentication