"[Jwas J]" wrote:
>
> service(ServletRequest req,ServletResponse res) will be called
> by the servlet Container and then it calls the protected method
> service(HttpServletRequest req, HttpServletResponse resp) after
> filling or creating the HttpServletRequest, HttpServletResponse
> objects.
>
> How does this convertion take place ?
>

 The part of the container that parses incoming HTTP
requests already knows that it needs to create HttpReq/
Rsp objects, so there's no "conversion" needed other
than a cast.

 In Tomcat 4, you get something along the lines of:

 Connector receives incoming HTTP request from a socket
and creates the HttpServletRequest/Response objects. The
Connector passes the request and response (as generic
ServletRequest/Response objects) on to other parts of the
container, which eventually call your servlet's public
service(ServletRequest,ServletResponse) method. Since the
params were created in the first place as HttpServlet
Request/Response, the public service() method just needs
to cast them, and then call your HttpServlet's
protected service() method.

 Note that j.s.GenericServlet plays no role in this part
of the processing, it's just:

  HttpServlet.service(ServletRequest,ServletResponse)
  HttpServlet.service(HttpServletRequest, HttpServletResponse)

 Take a look at:

http://cvs.apache.org/viewcvs/jakarta-servletapi-4/src/share/javax/servlet/http/HttpServlet.java?rev=1.1.1.1&content-type=text/vnd.viewcvs-markup

 for more details.

--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to