Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get Remote User?

Status
Not open for further replies.

Vadim

Programmer
Feb 5, 2002
75
US
Hi, I run servlete on Tomcat 4.0.1.
This statenment:
request.getRemoteUser();
return back a null.

Please, tell me how to get that info.


 
Hi Vadim,

request.getRemoteUser() is used to get the username someone has used to log in to your website. You probably get the null because you do the request before someone has logged in.
You can always use request.getRemoteAddr() to get the visitors ip at any time.
If you stored the name of the user in a session you can also use session.getAttribute("user or whatever you called it when you put it in the session")

Hope this helps.

regards, goaganesha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top