Hi,
I've realized a web project using JSP and servlet;
All works fine!
But I want to better understand what happens when doPost or doGet method is invoked;
that is, a simple servlet look like this:
public class SimpleServlet
extends javax.servlet.http.HttpServlet
implements javax.servlet.Servlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
My questions:
1) As
HttpServletRequest and
HttpServletResponse are interfaces, the
request and
response parameter are interfaces?
or Does it mean
request and
response must be objects of a Class that implements, respectively,
HttpServletRequest and
HttpServletResponse?
2)Then, who does invoke doGet() and doPost() methods?
The webserver?
3)What way does the caller use in order to create request and response objects, that must be passed to doPost and doGet?
I hope it's clear.
Thank you in advance.
MargNat