On Mon, Apr 29, 2013 at 4:54 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Leon,
>
> On 4/29/13 10:36 AM, Leon Rosenberg wrote:
> > On Mon, Apr 29, 2013 at 3:49 PM, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> > Leon,
> >
> >
> > So your initial implementation was a Filter that marked each
> > HttpSession with the origin IP address (so you could get the TLD
> > of the user) and then a Listener to keep track of the sessions?
> > What's wrong with that?
> >
> >
> >> It seemed to complicated. I now could strip it down to 1 file,
> >> that is both HttpSession and ServletRequest- Listener:
> >>
> http://svn.anotheria.net/opensource/moskito/trunk/moskito-web/java/net/anotheria/moskito/web/session/SessionByTldListener.java
>
> Note
> >>
> that, although this is a single class, you might get two separate
> objects created by Tomcat: one as the ServletContextListener and one
> as the HttpSessionListener. How do you attach the listeners to the
> webapp? Via web.xml or some other way?
>

one entry in the web.xml for now. It works at least in tomcat 7, but I
haven't tested it further. Its also the same object (now). But you are
right, I will make the counting part static ;-).


>
> I don't know what the container does if a <listener> implements more
> than one interface... I've never personally cared about such a scenario.
>
> >> The drawback is, I can count only from second request, because
> >> the session is created later. And I don't want to create sessions
> >> on all requests. I'm thinking about moving (duplicating) the call
> >> in requestDestroyed.
>
> Well, you only care about requests that actually create sessions, so
> the "first request" is not really relevant. Or do you mean that the
> request listener gets the event /before/ the session is created. Hmm.
>

Exactly. Its also logical to me, that this happens this way, because at the
moment of request creation of the first request noone called
getSession(true) yet.

regards
Leon


>
> >> The request that occur simultaneously in chrome(only) are
> >> pictures and js, replied with 304:
> >
> >> 1. Request URL:
> >> http://localhost:8080/moskitodemo/js/wz_tooltip.js 2. Request
> >> Method: GET 3. Status Code: 304 Not Modified 4. Request
> >> Headersview source 1. Accept: */* 2. Accept-Encoding:
> >> gzip,deflate,sdch 3. Accept-Language: en-US,en;q=0.8 4.
> >> Cache-Control: max-age=0 5. Connection: keep-alive 6. Cookie:
> >> JSESSIONID=712222474A695869D2494E2135CBCEAF 7. Host:
> >> localhost:8080 8. If-Modified-Since: Sat, 27 Apr 2013 21:49:44
> >> GMT 9. If-None-Match: W/"35082-1367099384000" 10. Referer:
> >> http://localhost:8080/moskitodemo/mui/mskShowAllProducers 11.
> >> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3)
> >> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.65
> >> Safari/537.36 5. Response Headersview source 1. Date: Mon, 29 Apr
> >> 2013 14:24:36 GMT 2. ETag: W/"35082-1367099384000" 3. Server:
> >> Apache-Coyote/1.1
> >
> >
> >> Even, the requests are keepalived they look to me as if they were
> >> executed parallel. At least from the chrome timeline. But its
> >> hard to tell without further investigation.
>
> Yeah, you might have to use a packet-sniffer.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJRfomfAAoJEBzwKT+lPKRY89cQAJjLc/xH++tfrNubd9eE+3s3
> UKI5prfRYogHXsXzUG/sB1GS2Gpii+6Qtzuen+/9eHp9zfirKWpWFhk2yPQi1MTz
> oyXQmrXOlYtKwg9iX7FQnkrHfzXbT3Qx5vzrHemf4uwOBhZ9SyutzJsomeHi8Ev0
> B7VMZoKz+APyDLQvCyEYKrJpFwtTcD18RaknUKQzgYxFafh98jL6J0icyv3gq9JW
> MJdl1VSgY0SdkoYitAmDE4Z0qQ9pV6QbS7z4W0VBC9UzxwsG6c+c94ncz3G4WKaa
> mTNvY7SO/PR/z7FNbfo9AO6pvCZ+5SGnxoQ6C99BdJ/Eo8F78tSVR36H7IC5gNKz
> rDJN5tLkCIRcWz3KHeqstL4EnB7FyO838bSamKdOExAEa5+zZCREf8T9D4L6dcCb
> s+bxB+j/fJKSIRXkfiqNozIJ+uwPmr1P/vEqiWEjEVdMJEo2ByTK4Jnx8FJcAi99
> sgVLK0fTH+7J85sSArF2zatZO8LxPE860rNR2CbU/NeeXI1MhxlJnGgPd6jIuOtA
> 8QA17rilYIOWp4icQOqubS2j4g3HmpgMDGnoD59DDJRN5odUPQEDzYYD04XjjeQp
> VZFSUdThfxSIzp4CBLmHXTiHXMkgflu5MF0aq0oa6T0eU6SNXkoAr7TC4wB/sHNR
> 2JCE36iSziLeIJHKTgmQ
> =W8Ia
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to