SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Thanks & Regards,
Srikanth Nalam.
Ankit Garg wrote: You can create a constructor for your Servlet class, but at that time, the ServletConfig instance is not ready and other resources might not be available.
Sony Agrawal wrote:
Ankit Garg wrote: You can create a constructor for your Servlet class, but at that time, the ServletConfig instance is not ready and other resources might not be available.
1. Can you give me an example of the other resources that you are talking about (I am not able to figure out those resource )
2. when are the ServletConfig and ServletContext objects created?
The answers that popped is (please confirm)
ServletConfig()--- When a request for the servlet is received for the FIRST time? followed by constructors of the servlet being run.
ServletContext()-- When application is deployed.
3. If i override the jspInit(), then this method would be called from init(SevletConfig).Please confirm . Let me know if i am wrong
SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ankit Garg wrote:If the servlet has load-on-startup value set, then the servlet will be loaded (and the ServletConfig instance created) when the application is deployed.
SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
James Tharakan wrote:I am not sure of the load-on-startup thing...... but if that value is NOT set then when will the servletConfig object created?
The servlet container is responsible for loading and instantiating servlets. The loading and instantiation can occur when the container is started, or delayed until the container determines the servlet is needed to service a request.
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links