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 are its drawbacks of cgi?

559


What do you mean by singlethreadmodel interface?

572


Who is responsible for writing a constructor?

769


Servlet is pure java object or not?

712


Why filter is used in servlet?

518






What is Client-Server Computing?

1887


If servlet receives multiple requests, how many objects will it create?

817


Is servlet a framework?

534


What is the procedure for initializing a servlet?

540


Tell us something about servletconfig interface.

573


Can you create a deadlock condition on a servlet?

585


How do we share data using 'getservletcontext ()?

535


What is string tokenizer?

622


Hello, My project requirement is like I need to create a web page using MVC pattern. I hava a bean class, jsp page, servlet, service and dao. My jsp has two fields. One is dropdown list. The option values has to get populated from the database table. The other one is a text box and its value has to come from database table. As of now I have defined the fields in bean class, got the values from database using arraylists in dao class and I called this from service class. Can anyone please tell me the workflow of how the servlet will get this arraylist and populate the arraylist values as dropdown options in jsp page? Also I would like to know the role of bean class in MVC pattern? Thanks in advance!

1823


What are the disadvantages of storing session state in cookies?

622