• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How to control the order in which a servlet instance is created

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All.

Can anybody please let me know how to control the order in which a servlet instance is created other than <load-on startup>

Thanks
 
Saloon Keeper
Posts: 7100
165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll just say this: most reasons for why one might want to do this are likely rooted in bad design. So - why do you want to do this?
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:I'll just say this: most reasons for why one might want to do this are likely rooted in bad design. So - why do you want to do this?


Indeed! Red flag warning!

 
Tim Moores
Saloon Keeper
Posts: 7100
165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's the best red flag you can come up with?

Here ya go: http://www.google.com/search?q=red+flag+image&hl=en&prmd=imvns&tbm=isch&tbo=u&source=univ&sa=X&ei=13IPT_XSD4_4sgayoPwD&ved=0CCIQsAQ&biw=1227&bih=1000
 
Bear Bibeault
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Better?



Personally, I like the sign because it better conveys danger!
 
Ranch Hand
Posts: 165
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ravisha andar wrote:Hi All.

Can anybody please let me know how to control the order in which a servlet instance is created other than <load-on startup>

Thanks



Use <load-on-startup>, thats more easier
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I depends on when you call the servlet .

you can have design of your own like load the instance one after the other.
depending on the order you wanted
 
Bear Bibeault
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

pankaj patil wrote:I depends on when you call the servlet .


No, it most certainly does not.

The container can load the servlets any time it wants in whatever order it wants in the absence of directives to the contrary. There is no guarantee that the container will wait until first request, and that the order will be determined by the order of requests.
 
Sheriff
Posts: 26777
82
Eclipse IDE Firefox Browser MySQL Database
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The obvious questions at this point are:

(1) Why do you need to control the order in which servlet instances are created?

(2) Why is the load-on-startup feature not sufficient for whatever you need?
 
Bear Bibeault
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the "why?" question has been asked numerous times, but not answered.
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic