File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes About response from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "About response from servlet" Watch "About response from servlet" New topic

About response from servlet

raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 288
Someone please explain how response is send back from servlet to browser?
what i understand is, in servlet we write everything in HttpResponse onject ,which then taken by Container and is then used to send HTTP response to client.
But what container do with HttpResponse onject? I mean what are the webserver and webcontainer's responsiblities in handling the response? they both are confusing me about their individual role in returning response to the client.
[ October 22, 2007: Message edited by: raj malhotra ]
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

If you look at some sample code, you don't write to the HttpResponse, you write to an OutputStream obtained from the HttpResponse. This Stream acts like any other - it can be buffered or send data straight to the client, but that is up to the container.
I agree. Here's the link:
subject: About response from servlet
It's not a secret anymore!