Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is forward can call after response generation

 
balakrishna nannaka
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if forward or request dispatcher can call after generating some respone in the servlet which is called
 
Harpreet Hira
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by generating some response?
You can forward a request to another resource, if you have NOT committed(flushed) response to the browser.

You must be thinking how "committing a response" is different from "generating some response" ?
Generally we take a PrintWriter(out) from response and do out.println() to write something to response. This is NOT committing the response. The response is committed either on calling flush() explicitly, or when the response size increases the buffer size(8KB is default buffer size) or when you service() method completes execution and control goes back to Servlet Container.

So, in a nutshell, if you have NOT flushed the data in a servlet or JSP and NOT exceeded the buffer size you can forward the request to some other resource in the same context.
 
dema rogatkin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible if chunked transmission used.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic