Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

suraj kumar


{ City } bhubaneswar, orissa
< Country > india
* Profession * lead consultant
User No # 38653
Total Questions Posted # 3
Total Answers Posted # 2

Total Answers Posted for My Questions # 5
Total Views for My Questions # 20087

Users Marked my Answers as Correct # 18
Users Marked my Answers as Wrong # 5
Questions / { suraj kumar }
Questions Answers Category Views Company eMail

What is Connection Pooling?

Enteg Technologies, Infosys, Polaris,

1 Advanced Java 6447

What are Benefits of Connection Pooling?

2 Advanced Java 6301

What are uses of Hash Code?

Cognizant,

2 Core Java 7339




Answers / { suraj kumar }

Question { Ericsson, 23783 }

Can we call destroy() method inside the init() method? What
happens when we do so?


Answer

This action does not disturb the normal life cycle flow of the servlet. The servlet will work normal. You may test the below code.

/**
* @author Suraj
*
*/
public class TestServlet extends HttpServlet {


public void init(ServletConfig config)throws ServletException{
super.init(config);
destroy();
}

protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {

System.out.println("I am test servlet.");
}

}

Web.xml
--------------------------------------


Servlet

TestServlet
com.esspl.TestServlet


TestServlet
*.do


------------------------------------
Test URL: http://://TestServlet.do

Is This Answer Correct ?    10 Yes 4 No

Question { Accenture, 13718 }

Why does most servlets extend HttpServlet?


Answer

Yes, HttpServlet simplifies the handling of HTTP protocol but there is no hard and fast rule that the servlet class must extend abstract HttpServlet class. it may extend GenericServlet class to make the Servlet protocol independent.

Is This Answer Correct ?    8 Yes 1 No