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 do we share data using 'getservletcontext ()?

1098


What is the use of java servlet api?

1089


Differentiate between get and post?

1210


Why is a constructor needed in a servlet even if we use the init method?

1213


What are the types of servlets? Explain

1329


How can we perform any action at the time of deploying the project?

1166


What is session?

1125


What is meant by a web application

1068


Is tomcat a servlet container?

1113


What is the effective way to make sure all the servlets are accessible only when user has a valid session?

1122


What do you mean by chaining in servlet?

1081


Difference between GET and POST?

1221


What are the functions of Servlet container?

1174


Why do we have servlet wrapper classes?

1115


How does java thread pool work?

1187