File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Servlets
Author
default constructor and init method
Brij Garg
Ranch Hand
Joined: Apr 29, 2008
Posts: 234
posted
Aug 14, 2008 03:47:00
0
container first calls the default constructor and then the init method.
Is it corrent or it is other way around ?
thanks
David O'Meara
Rancher
Joined: Mar 06, 2001
Posts: 13459
I like...
posted
Aug 14, 2008 04:13:00
0
how would it call the init method on an instance before it was created using the constructor?
Brij Garg
Ranch Hand
Joined: Apr 29, 2008
Posts: 234
posted
Aug 14, 2008 07:29:00
0
If i am not wrong you are saying that container calls constructor first and create the instanace and then this instance calls the init method.
Please correct me if i am wrong.
David O'Meara
Rancher
Joined: Mar 06, 2001
Posts: 13459
I like...
posted
Aug 14, 2008 07:45:00
0
Correct. A
servlet
is the same as any Java Class: you need to create an instance via a constructor before you can call methods on the instance.
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: default constructor and init method
Similar Threads
Destroy Method in servlet constructor
Init() Vs Constructor
when does a servlet clas get servletness ?
servlet creation-init() or constructor
init() method on servlets
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter