Craig, I have had some of the same issues to deal with. I accomplished this using a filter instead of a listener. The reason I used a filter is because it had access to the request and response information. A listener only had access to the session. For config information I used a class I wrote and obtained via a built-in JNDI resource. The class contained a static hash table that I populated with individual session (i.e. web app) information. I configured the filter to only look at requests of .jsp or servlets, otherwise everything comes through the filter (graphic requests, html, etc.
If this is not enough to get you started, I would be happy to fill in some more specifics. Doug Srofe WDS interaktiv -----Original Message----- From: Craig Longman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 1:56 PM To: tomcat-user Subject: Managing a Listener i have a need for some data that is needed by every page. Ideally, this would simply be a class that is shared by everything else in one webapp subdirectory, and available in the page context or session. the only way i can see to do this (based on the docs at least) is to configure a Listener to look for new session evens, and store an object in the session that can be used to access the information. however, i would definitely want this listener to be able to read init information and find the preferred logger, etc. how is this accomplished? the listener, although configurable from the server.xml file, seems to receive no config information. it needs to have things like a configuration file name passed to it. the other way i guess would be to split up the thing into two (conceptually at least), one listener and something else that gets initialized by the container. would that have to be a servlet then? is there any way of just initializing 'objects' in server.xml? -- CraigL->Thx(); Be Developer ID: 5852 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
