tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Rosenberg <rosenberg.l...@gmail.com>
Subject Re: getting the request that created the session
Date Sun, 28 Apr 2013 16:07:13 GMT
Hello Konstantin,
thank you for your reply.


> Background, I want to count sessions by top level domains. I'm doing it
> now
> > in a combination of filter and listener. Filter for new sessions,
> putting a
> > mark for already counted sessions, and listener for destroyed session.
> > However, I would like to get rid of the Filter, if its possible somehow.
> > For that, I need to get user's ip adress somehow.
> >
>
> Just two ideas:
>
> 1. You can use javax.servlet.ServletRequestListener instead of a filter.
> 2. There is HttpSession.isNew() method.
>

So you mean that I can basically perform the same checks I do in a filter
in a servletrequestlistener, checking if there is an attached session, if
it's new, and where it comes from.
I haven't found it in the spec (or didn't search hard enough, at least
haven't found it in listener section), would ServletRequestListener being
notified prior to any Filter execution?

regards
Leon


>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message