aspose file tools*
The moose likes Tomcat and the fly likes HttpServletRequest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HttpServletRequest" Watch "HttpServletRequest" New topic
Author

HttpServletRequest

AJ Jose
Greenhorn

Joined: Nov 16, 2006
Posts: 4
This is a general question about WebServer-Appserver interface.

We know the servlet takes the input parameters of HttpServletRequest and HttpServletResponse objects. But the data comes to the input of Webserver as a general stream of text(HTTP). By the time the Webserver sends this request to any specific servlet in the Appserver; the text data need to get converted to a proper Java object.

My question is where exactly this conversion is done; or who converts HTTP to request object. Remember the same data in HTTP could be an input to as ASP as well which may be expecting a different object format.

Thanks in advance for the explanation of this problem.

Jose.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This is done in the connector.

Here is an SVN link to the coyote HTTP connector src:
http://svn.apache.org/repos/asf/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11Processor.java


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
My question is where exactly this conversion is done; or who converts HTTP to request object. Remember the same data in HTTP could be an input to as ASP as well which may be expecting a different object format.


The servlet container is responsible for creation of a HttpServletRequest object - initially only the headers are parsed. Whether or not the body is parsed as parameters or read as a stream is up to your program. Any forwarding mechanism must give the servlet container a complete request stream of bytes.

Bill
AJ Jose
Greenhorn

Joined: Nov 16, 2006
Posts: 4
That is a Great answer !!
Thanks a lot Bill.
Thanks Ben.

What is clear to me now, is that the the conversion to the respective object format happens not in the webserver but the corresponding application servers(for both servlet and ASP).

Thanks Again !!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpServletRequest