[java ee programming] Can we write a constructor in Servlets?

2010-03-30 Thread Nirmal Kumar
Hi All, Please answer the following questions: Swrvlet *1. Servlet is a Java class, then why there is no constructor in Servlet. Can we write a constructor in Servlets?* * * * 2. Implicit objects of JSP are available in destroy() method or not?*

Re: [java ee programming] Can we write a constructor in Servlets?

2010-03-30 Thread Alexey Filippov
1. Yes you can, but you will never need that, hence you should not. 2. No; those are service()-specific. On 30 March 2010 08:47, Nirmal Kumar wrote: > Hi All, > > Please answer the following questions: > > Swrvlet  1. Servlet is a Java class, then why there is no > constructor in Servlet.

Re: [java ee programming] Can we write a constructor in Servlets?

2010-03-30 Thread Mihai DINCA
Hi Nirmal, 1. There is a constructor somewhere in the servlet class hierarchy, but, as it is directly called by the server (you never make a "new" for a servlet), you don't care about it. When the servlet is created, the "init()" method is called immediately. So, if you have something to init

Re: [java ee programming] Can we write a constructor in Servlets?

2010-03-30 Thread bambang teleinfocom
HI, Let me add a little bit here, a.Servlet is built purposely as helper for dynamic web app server and it the container that control the Servlet; it is the java answer for dynamic web page to old cgi/bin. Servlet is loaded, initialized and created aka lifecycle ( defined in Deployment Descripto