• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lazy loading in servlet

 
Abhijeet Sharma
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody explain me what exactly is lazy loading in terms of servlet?

Thanks in advance,
Abhijeet
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in what context?
 
Abhijeet Sharma
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In context with servlet initialization ,A detailed explaination would be helpful..
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lazy loading means that you don't load something at start up, you wait until it is required. When applied to servlets you get a servlet that is not loaded at start up, it loaded when it is required.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A servlets when gets loaded with the first call , then its lazy loading.
Just do not put a load-on-start ,let the container load this on demand.
 
Abhijeet Sharma
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks david and rahul for the explaination..
I went through some links.. got another doubt on the same line..
what if i put <load-on-startup>0</load-on-startup> will this be invoed at starup up or on first request?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the value should be great that 0 and this is used for ordering of loading.May be you can do a quick check and let also know whats the result.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Abhijeet Sharma:
Thanks david and rahul for the explaination..
I went through some links.. got another doubt on the same line..
what if i put <load-on-startup>0</load-on-startup> will this be invoed at starup up or on first request?


Straight from the servlet spec:

The element load-on-startup indicates that this servlet should be loaded (instantiated and have its init() called) on the startup of the Web application. The element content of this element must be an integer indicating the order in which the servlet should be loaded. If the value is a negative integer, or the element is not present, the container is free to load the servlet whenever it chooses. If the value is a positive integer or 0, the container must load and initialize the servlet as the application is deployed. The container must guarantee that 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-startup value.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64175
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are writing servlets without having the Servlet Specification open on your desk, you're doing it wrong.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic