[7.0.x] About the websocket chat, how can I send the message to specified persons or group?
getting the request that created the session
Hi, is there any possibility to get the first request from a session (or any request from a session) from the HttpSessionListener. 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. thanks in advance Leon
RE: Question on servlet determination
On 4/25/2013 12:52 PM, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Question on servlet determination http://localhost:8080/examples/servlets/servlet/RequestInfoExample I get the example page with pathInfo=ll http://localhost:8217/examples/servlets/servlet/RequestInfoExample/ I also get the example page with pathInfo= My question is why the top url (with no trailing /) is getting the request at all, given the url-pattern in web.xml: servlet-mapping servlet-nameRequestInfoExample/servlet-name url-pattern/servlets/servlet/RequestInfoExample/*/url-pattern /servlet-mapping Likely because of these clauses in the spec: The container will recursively try to match the longest path-prefix. This is done by stepping down the path tree a directory at a time, using the '/' character as a path separator. The longest match determines the servlet selected. A string beginning with a '/' character and ending with a '/*' suffix is used for path mapping. (The above is from 3.0, section 12.1, rule 2, and section 12.2, first bullet.) But I haven't looked at the code to see how it's actually implemented. - Chuck I think you're right. It looks like it boils down to an interpretation of the rules. If you look a little further at the examples, this is an exact match for the /baz/* mapping. -Terence Bandoian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: getting the request that created the session
2013/4/28 Leon Rosenberg rosenberg.l...@gmail.com: Hi, is there any possibility to get the first request from a session (or any request from a session) from the HttpSessionListener. No. It is not possible to get request from within a HttpSessionListener. 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. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: getting the request that created the session
org.apache.catalina.valves.RemoteIPValve getRemoteIpHeader? Martin __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Sat, 27 Apr 2013 23:08:31 +0200 Subject: getting the request that created the session From: rosenberg.l...@gmail.com To: users@tomcat.apache.org Hi, is there any possibility to get the first request from a session (or any request from a session) from the HttpSessionListener. 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. thanks in advance Leon