how to handle error in ServletContextListener

Discussion in 'Java' started by vk02720, Jul 19, 2005.

  1. vk02720

    vk02720 Guest

    I am trying to initialize my webapp using ServletContextListener.
    How do I inform the Tomcat container that there was an error in
    contextInitialized() and hence not to make my webapp available ?

    I am using Struts in my webapp. Is it a good idea to do initialization
    using ServletContextListener or plug-in mechanism of struts ?

    TIA
    vk02720, Jul 19, 2005
    #1
    1. Advertising

  2. vk02720

    Wendy Smoak Guest

    "vk02720" <> wrote"

    > I am trying to initialize my webapp using ServletContextListener.
    > How do I inform the Tomcat container that there was an error in
    > contextInitialized() and hence not to make my webapp available ?


    http://www.mail-archive.com//msg114792.html

    - throw any RuntimeException
    - Set an Attribute in the request and have a Filter that checks for it and
    redirects to a 'not available' page.

    > I am using Struts in my webapp. Is it a good idea to do initialization
    > using ServletContextListener or plug-in mechanism of struts ?


    I would prefer the ServletContextListener just because it's part of the
    Servlet spec and more people will be familiar with it than the
    Struts-specific Plugin mechanism.

    --
    Wendy Smoak
    Wendy Smoak, Jul 19, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dietrich
    Replies:
    1
    Views:
    619
    Joe Smith
    Jul 22, 2004
  2. Todd Peterson
    Replies:
    0
    Views:
    2,448
    Todd Peterson
    Sep 11, 2003
  3. Leon
    Replies:
    2
    Views:
    500
  4. =?ISO-8859-1?Q?KLEIN_St=E9phane?=
    Replies:
    3
    Views:
    429
    hanumizzle
    Oct 6, 2006
  5. Federico @ Work
    Replies:
    1
    Views:
    1,005
    Kevin McMurtrie
    Oct 15, 2009
Loading...

Share This Page