• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpServletRequest

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic