Announcement Announcement Module
No announcement yet.
Threading Question Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Threading Question

    I saw most of the samples set the load-on-startup to 2 for the DispatcherServlet.

    Why we need more than one DispatcherServlet instances?
    If all the instances have the same values, does multiple DispatcherServlets can handle requests faster than one DispatcherServlet.doService()?

    thanks :?

  • #2
    Well, load-on-startup determines when the servlet should be loaded and not how many thread (copies) to load
    Originally posted by a description I found somewhere
    The load-on-startup element indicates that a servlet should be loaded on the startup of the web application. This element can take an integer value which indicates the order in which the servlet should be loaded.

    If the value is negative, or if this element is not present, the container is at its will as to when it should load the servlet. If the value is a positive integer or 0, the container must load and initialize the servlet when the application is deployed.

    Generally the servlets marked with lower integers are loaded before servlets marked with higher integers. The container may choose the order of loading of servlets with the same load-on-start-up value.
    Hope this makes it clear.