capturing IP address and User name
1 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Monday, August 19, 2002 01:53 PM

capturing IP address and User name

I'm trying to capture the IP address and user name of the person submitting the form. I use basic and windows authentiation and it works, however it causes a problem for users under a different domain that are trying to connect to my domain. The form is a JSP with hidden fields that call a servlet. Can someone help?

Re: capturing IP address and User name

Posted By:   Eelco_Cramer  
Posted On:   Tuesday, August 20, 2002 12:34 AM

The username of a connecting user can be accessed by HttpServletRequest.getRemoteUser(). You can access it from your JSP by calling request.getRemoteUser(). HttpServletRequest also inherits getRemoteAddr() from ServletRequest so you can access the users IP adress by calling: request.getRemoteAddr().
About | Sitemap | Contact