File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How do u find out the client username? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How do u find out the client username?" Watch "How do u find out the client username?" New topic
Author

How do u find out the client username?

Dean Fredericks
Ranch Hand

Joined: Dec 04, 2004
Posts: 60
Ive set up security in my web.xml, and server.xml

I see the method req.isUserInRole(),

But what I really want is the calling clients username.

How do I get this??

Thanks
Dean


PLEASE WATCH THIS VIDEO: <a href="http://www.glumbert.com/media/dolphin" target="_blank" rel="nofollow">http://www.glumbert.com/media/dolphin</a><br /> <br /><-- that video is no joke. Spread the word... this cant go on!!!<br /> <br />SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCMAD 1.0
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
"request.getRemoteUser()" is that what you want?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Try req.getUserPrincipal().getName().


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do u find out the client username?
 
Similar Threads
Error in invoking a servlet from an applet (loaded in a browser)
user authentication with speech recognition
Checking with Querystring
Help:: how can I do the base64 encoding?
splitting a string