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

What is the difference between sendredirect() and forward() in a servlet?

1019


What are the different session tracking techniques?

1198


What is cgi and what are its drawbacks?

1070


When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?

1106


What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?

1253


Where do you define dispatcherservlet?

1052


What is a servlet context?

1167


What is the dispatcher servlet?

986


How is an application exception handling is done using a servlet?

1022


Why do we need a constructor in a servlet if we use the init method?

1053


What is a java servlet?

1097


How can you start a jta transaction from a servlet deployed on jboss?

1166


How do I know if java is running on linux?

1127


Servlet is pure java object or not?

1196


How servlet is created?

1217