On 10 Sep 2002, Craig Longman wrote: > On Tue, 2002-09-10 at 14:11, Srofe, Douglas (c) wrote: > > Craig, > > > > [...snip...] > > > > If this is not enough to get you started, I would be happy to fill in some > > more specifics. > > i see your point, and that makes good sense. in my particular case, i > think that the session would still be a better way to go though, all i > really need is to have it configure the information once. > > my real problem is more generic i guess, how do i initialize a listener > (or a filter for that matter) with some basic webapp information, like > where to log, getting configuration information, etc. > > until now, i've always just done it via a servlet, but i'd like to use > these new things (listeners/filters/etc) properly, but if i can't log or > configure them from the server.xml file, then i will have to resort to a > servlet. i hate not being able to log information from components.
Maybe you can make use of a context listener. (Don't ask me for details, because I haven't used them, but it just strikes me from some of what you say you need to do that a context listener may help.) Also, perhaps you can use the context attributes feature (and then maybe you won't need to do anything with sessions). > > -----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]> > > > -- > > CraigL->Thx(); > Be Developer ID: 5852 > > Milt Epstein Research Programmer Integration and Software Engineering (ISE) Campus Information Technologies and Educational Services (CITES) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
