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

What are the parameters of the service method ?

Answer Posted / chadnra kunchala

well, there are two service methods we have.
one is, public service()
second is protected service()

when ever a browser sends a request to server, first it
invokes public service(ServeletRequest req, ServletResponse
res) throws ServletException, IOException
{ }
after calling public service method it invokes the protected
service() method like the following
public service(ServletRequest req, ServletResponse res)
throws ServletException, IOException
{
HttpServletRequest hreq = (HttpServletRequest)req;
HttpServletResponse hres = (HttpServletresponse)res;
protected service(hreq, hres);
}
then,
The protected service() method will idendtify the
requested method whether it is GET OR POST OR PUT like that
, then it invokes the correspondin method like doGet()or
doPost() or doPut() like that..

recommended to override doGet() or doPost() or and..... so
on, not service method()..

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How a servlet is unloaded?

1029


What is the need of session tracking in web application?

976


How to generate the server side programming and the advantages of it over the other languages?

941


Write a servlet to upload file on server.

1035


How do we call one servlet from another servlet?

981


What is the use of attribute in servlets?

1003


What are the exceptions thrown by servlets? Why?

1099


Write all the phases defined in servlet life cycle?

1056


What’s the difference between forward() and sendredirect() methods?

957


What is cookie in servlet?

1011


What is a servlet engine?

969


How can the referrer and the target urls be used in servlet?

948


When jsessionid is created?

999


What is a web container and what is its responsibility?

925


What is the use of welcome-file-list?

977