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

Explain the difference between a web server and a web container?

0 Answers  


Can filter be used as request or response?

0 Answers  


Which is better approach among four(HttpSession,cookie,URL Rewriting, Hidden Fields) Session Tracking technic's ? Why ?

3 Answers   L&T,


What is the need of session tracking in HttpServlet ?

3 Answers  


What is meant by cookies?

0 Answers  


Name the different ways of session tracking.

0 Answers  


What is the difference between callling a RequestDispatcher using ServletRequest and ServletContext?

2 Answers  


What do you mean by cgi and what are its drawbacks?

0 Answers  


What is difference between get and post method?

0 Answers  


Which exception is thrown if servlet is not initialized properly?

1 Answers  


Explain load on start-up and its importance?

0 Answers  


Why setMaxAge() and getMaxAge() methods are used in Cookies?

2 Answers  


Categories