Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpServletRequest

 
AJ Jose
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • 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
  • 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 !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic