Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7012

servletcontext listener vs servlet with high priority on loading

From "a" <a@mail.com>
Newsgroups comp.lang.java.programmer
Subject servletcontext listener vs servlet with high priority on loading
Message-ID <1VO0q.42336$nj1.39176@newsfe19.iad> (permalink)
Date 2011-08-11 04:18 -0700

Show all headers | View raw


Hi,

I have a question about initializing the web app. There are 2 ways to do the
initialization.
1> Create a servlet with high loading priority on web.xml.
2> Use servletcontext listener

Why the second way is better?

I used to use a class with static logger to standardize the format of the
log. I cannot use this class because  it has not been loaded when the
servlet context event is sent.
Is there anyway to overcome my problem if I use the servletcontext listener?

Thanks

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar


Thread

servletcontext listener vs servlet with high priority on loading "a" <a@mail.com> - 2011-08-11 04:18 -0700
  Re: servletcontext listener vs servlet with high priority on loading jaap <niemand@meel.homelinux.net> - 2011-08-11 14:37 +0200
  Re: servletcontext listener vs servlet with high priority on loading markspace <-@.> - 2011-08-11 07:06 -0700
    Re: servletcontext listener vs servlet with high priority on loading "a" <a@mail.com> - 2011-08-11 11:46 -0700
      Re: servletcontext listener vs servlet with high priority on loading markspace <-@.> - 2011-08-11 12:16 -0700
        Re: servletcontext listener vs servlet with high priority on loading Lew <lewbloch@gmail.com> - 2011-08-11 12:51 -0700
          Re: servletcontext listener vs servlet with high priority on loading "a" <a@mail.com> - 2011-08-11 13:59 -0700

csiph-web