Results 1 to 2 of 2

Thread: Spring MVC - use DispatcherServlet to optionally load a testservlet

  1. #1
    Join Date
    May 2009
    Posts
    6

    Default Spring MVC - use DispatcherServlet to optionally load a testservlet

    I have a TestServlet. I want to set a configuration parameter through which I can decide if I want to load this servlet on startup. I want to do this using the dispatcherServlet.

    Can someone please explain how I can do this.

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    Don't go through DispatcherServlet, insted implement a listener that reads the configuration parameter and loads the servlet/does nothing depending on parameter value. Then register your listener in web.xml.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •