aspose file tools*
The moose likes Servlets and the fly likes Doubt in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Doubt in servlet" Watch "Doubt in servlet" New topic
Author

Doubt in servlet

jai gurudev
Greenhorn

Joined: May 28, 2004
Posts: 20
hi,

any body clear my doubt.

1)can we declare constructor in servlet
2)how to do FTP using Servlet-give some code examples
3)how servlet is calling init() method since it is not a Static method,it is calling directly

regards

jaigurudev
smitha verghese
Ranch Hand

Joined: Jun 21, 2003
Posts: 42
1)can we declare constructor in servlet
Its not possible to have a constructor since life cycle of a servlet is design having init, service and destroy

2)how to do FTP using Servlet-give some code examples
try search in google or hope this helps
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2955&lngWId=2

3)how servlet is calling init() method since it is not a Static method,it is calling directly

servlet's init method will be invoked at its first hit /request.
Note: doesnt get invoked all time u request for the servlet


Hope this helps
smitha
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

Its not possible to have a constructor


It is most certainly possible to have a constructor. it's just not a good idea to try to use it to perform any initialization because the base class will call the init() function when it is ready for you to perform your servlet-specific initialization (making constructs like ServletConfig available).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
jQuery in Action, 2nd edition
 
subject: Doubt in servlet