Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8412355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:39:11+00:00 2026-06-10T00:39:11+00:00

given a simple servlet in WEB-INF/web.xml like <servlet> <servlet-name>MyServlet</servlet-name> <servlet-class>app.MyServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> is it

  • 0

given a simple servlet in WEB-INF/web.xml like

<servlet>
    <servlet-name>MyServlet</servlet-name>
    <servlet-class>app.MyServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

is it possible to override load-on-startup in my local dev environment so that the servlet is only loaded when first requested, without altering MyServlet class?

Altering web.xml is acceptable as long as the default is for the servlet to load when tomcat starts, could this be done with a context-param ?

I’m running tomcat 7.0.29

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:39:12+00:00Added an answer on June 10, 2026 at 12:39 am

    Without modifying the web.xml? No you can not (to my knowledge). You can however remove the declaration completely and use the @WebServlet annotation, you can then modify loadOnStartup in the .java file directly.

    @WebServlet(name="MyServlet", value="/MyServlet", loadOnStartup=1)
    public class MyServlet extends HttpServlet {
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a simple C# class definition like: [System.Windows.Markup.ContentProperty(PropertyOne)] public class SimpleBase { public string
given the simple xml snipet... <workers> <worker> <name>Fred</name> <dob>19410501</dob> </worker> <worker> <name>Fred</name> <dob>19410501</dob> </worker>
Given a simple Silverlight Grid like this: <Grid ShowGridLines=True> <Grid.ColumnDefinitions> <ColumnDefinition x:Name=MyColumn Width=2* />
Given a simple data set, I would like to be able to calculate a
Given a simple class: public class Person { public string FirstName; public string LastName;
Given a simple parent/child class structure. I want to use linqkit to apply a
Given the following simple program: import wx class TestDraw(wx.Panel): def __init__(self,parent=None,id=-1): wx.Panel.__init__(self,parent,id,style=wx.TAB_TRAVERSAL) self.SetBackgroundColour(#FFFFFF) self.Bind(wx.EVT_PAINT,self.onPaint)
what I want to do is a image recognition for a simple app: given
Let's say I have a simple Login servlet that checks the passed name and
Given a simple Ext.List like the one in the Sencha docs, how can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.