Fine & Thanks
Suppose if the servlet container supports another protocol (say XXX) .
In that case the container first check the protocol used by the client ...
If the client is using XXX then the XXXServlet (similar to HttpServlet)'s service method is called and there
it will cast the ServletRequest,ServletResponse to XXXServletRequest,XXXServletResponse .
After that it will call the protected service method of XXXServlet , say service (XXXServletRequest,XXXServletResponse) ...
Is my concept correct ?
Some more doubts is ( This is regarding Tomcat )
Where can i get the class diagram or Technical diagram of Tomcat ?
is it available in the net ?
Also regarding the connectors , it would be nice if some one can provide info regarding the part of tomcat which populated the request , response object
ir before calling the public method service .
Jwas
| "Christopher K. St. John" <[EMAIL PROTECTED]>
Sent by: "A mailing list for discussion about Sun Microsystem's Java Servlet API Technology." <[EMAIL PROTECTED]> 06/04/02 07:07 PM
|
To: [EMAIL PROTECTED] cc: Subject: Re: GenericServlet & HttpServlet |
"[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
