File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Can we use constructors instead of init() in servlets? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Can we use constructors instead of init() in servlets?" Watch "Can we use constructors instead of init() in servlets?" New topic
Author

Can we use constructors instead of init() in servlets?

Anto Telvin
Ranch Hand

Joined: Aug 12, 2008
Posts: 113
hi all

It is possible to use constructors instead of init(). if yes then how web container will call that and other life cycle methods


Anto Telvin Mathew<br />Many of the life failures are people who did not realize how close they were to success when they give up. EDISON
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Not if you want to do anything substantive at startup.

Why would you not want to use the proper approach?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

See also this recent topic on this issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we use constructors instead of init() in servlets?