in data 18/05/2005 14.46 Piepaolo Follia ha scritto:

You can get it from the request: put a filter in the request chain and in the doFilter method see if the session is a new session:

public void doFilter(ServletRequest request, ServletResponse response,
           FilterChain chain) throws IOException, ServletException {
   if(((HttpServletRequest)request).getSession().isNew()) {
       //Do your stuff here with request.getLocalAddr()
   }
   chain..doFilter(request, response);
}

Sorry...the method for getting the ip address from request is request.getRemoteAddr(), and not the local one! :-)

--
Pierpaolo Follia
Wave S.r.l. - Vai Benaco 24/B, Bedizzole (BS)
Telefono: +39 030 687561
Fax: +39 030 6875690




Reply via email to