• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Buffering in Jsp

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP container buffers data (if the jsp directive specifies it using the buffer attribute) as it is sent from the server to the client. Headers are not sent to the client until the first flush method is invoked. Therefore, it is possible to call methods that modify the response header, such as setContentType, sendRedirect, or error methods,up until the flush method is executed and the headers are sent. After that point,
these methods become invalid, as per the Servlet specification.


Q1) What is use of buffering the jsp?

Q2) what is advantage of modifying reponse headers?
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For eg: you can have one scenario where you have a filter to modify the response header content type by zipping the response if its too large to send over the wire. Or for the same reason you want to buffer the JSP not to generate the jar file again and again to send but just buffer it.

Hope this hleps
Nileesha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic