WSServlet and Multiple Web Services

Posted on 2009-02-11
Last Modified: 2013-11-24
I'm reading about WSServlets at
And would like to ask about <load-on-startup>1</load-on-startup>, how do the numbers work?
Where or what is this number compared to?

The <load-on-startup> that I have, have duplicate numbers and the complete sequence is not there.  The numbers jump form 1 to 8 and 9, then 11.  Granted each of the web.xml files are not related.
Question by:chima
    LVL 59

    Expert Comment

    by:Kevin Cross
    Hello chima,

    The number specified as content of this tag is the order in which the servlet should be loaded if it matters.  So you don't need to have all the numbers in sequence.  Just note that the servlet(s) with value of 1 will be loaded before servlet(s) with value of 8, 9, or 11.


    LVL 59

    Accepted Solution

    (here is a nice explanation --

    This tag specifies that the servlet should be loaded automatically when the web application is started.

    The value is a single positive integer, which specifies the loading order. Servlets with lower values are loaded before servlets with higher values (ie: a servlet with a load-on-startup value of 1 or 5 is loaded before a servlet with a value of 10 or 20).

    When loaded, the init() method of the servlet is called. Therefore this tag provides a good way to do the following:

        * start any daemon threads, such as a server listening on a TCP/IP port, or a background maintenance thread
        * perform initialisation of the application, such as parsing a settings file which provides data to other servlets/JSPs

    If no  value is specified, the servlet will be loaded when the container decides it needs to be loaded - typically on it's first access. This is suitable for servlets that don't need to perform special initialisation.

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    wordsFront challenge 8 47
    sumHeights2  challenge 7 51
    bunnyEars challenge 6 45
    pairstar challenge 2 26
    What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
    This video is a brief demonstration on how to use security groups and Network Access Control Lists (ACLs) in Amazon Web Services.  Security groups and Network ACLs are mechanisms you can use in AWS to control network traffic.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now