MY mENU


Friday 16 March 2012

How to Develope Our Servlet As the Best Http Servlet?


Step 1: 
 Keep programmers initialization logic [like getting  DB  connection] by overriding public void init() method.
 If programmers initialization logic is placed by overriding public void init(servltconfig eg) make sure that you are calling super.init(eg) method from it .
Step 2:
 Instead of placing request processing logic in the service() method it is recommended to place request processing logic by overriding  doxxx() methods like doGet(),doPost() method. Because these are developed based on HTTP protocol and provides error messages .
Step 3:
Close All opened resources (Jdbc connections , File closing,network connections) in destroy().

No comments:

Post a Comment