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...


how this statement works..?
public void service(HttpServletRequest
request,HttpServletResponse response)

Answers were Sorted based on User's Feedback



how this statement works..? public void service(HttpServletRequest request,HttpServletResponse res..

Answer / sanjeev kumar

When ever a http client request is sumbitted servlet engine
will received this request and it identifies the proper
servlet to handle this request from web.xml and calls the
public service method of the perticular servlet. Internally
this public service will call the private service method
and private service method will call the doGet() or doPost
() method based on the client request. This public void
service(HttpServletRequest request, HttpServletResponse
response) will be called once per the request.

Is This Answer Correct ?    11 Yes 0 No

how this statement works..? public void service(HttpServletRequest request,HttpServletResponse res..

Answer / shubha

1.servlet container calls the service(servletreq,
servlrtResp) method of HTTPServlet.
2.the service(ServletReq, ServletResp) method of
HTTPServlet calls the service(HttpServletReq,
HttpServletResp) method of the same class. in this service
method is overloaded in the HttpServlet class.
3.service(HttpServletReq, HttpServletResp) mthos alayse the
request and findout which HTTP method is being
used.Depending on Http method appropriate doXXX() mthod
will be call.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Servlets Interview Questions

what is servlet chaining?

0 Answers  


Define context initialization parameters.

0 Answers  


Explain servlet life cycle?

0 Answers  


What is a parser. What does a parser do with a XML? Why do we need it?

1 Answers  


What is a java servlet?

0 Answers  


Write a program to show the functionality of doget and dopost method?

0 Answers  


What do you mean by default initialization in java servlet?

0 Answers  


Is there any differance b/w getting servlet context from servlet config and session? if yes then what is that?

7 Answers  


Hi frnds iam new to Java Kindy any one can provide or me Servlets Example code and can explain to me flow of servlets and as Jsp and Struts and provide to me some sample example on these 3 topic flow,code example,and tutorials,and related websites which i can refer....thanks in advance..........

3 Answers  


What is the purpose of requestdispatcher interface?

0 Answers  


How threads are implemented in servlets?

3 Answers  


Difference between doget and dopost?

0 Answers  


Categories