how this statement works..?
public void service(HttpServletRequest
request,HttpServletResponse response)
Answers were Sorted based on User's Feedback
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 |
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 |
Explain the difference between a web server and a web container?
Can filter be used as request or response?
Which is better approach among four(HttpSession,cookie,URL Rewriting, Hidden Fields) Session Tracking technic's ? Why ?
What is the need of session tracking in HttpServlet ?
What is meant by cookies?
Name the different ways of session tracking.
What is the difference between callling a RequestDispatcher using ServletRequest and ServletContext?
What do you mean by cgi and what are its drawbacks?
What is difference between get and post method?
Which exception is thrown if servlet is not initialized properly?
Explain load on start-up and its importance?
Why setMaxAge() and getMaxAge() methods are used in Cookies?