Originally posted by chaminda darshana kiriwendala:
Hi friends,
Could you tell me why cann't we initialize servlets in constructor. Why do we use separate "init()" method?
[ October 17, 2007: Message edited by: Bear Bibeault ]
you can not overridding the init() method;
init(servletConfig config),service(),destroy()
are three backup method and also per the servlet life cycle ,the container has its responsibility to call init(),and servlet contrainer can init some servlet object,
if you overridding this method ,you can not get some objects ,such as servletconfig and so on;