Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.getWriter() out and jsp out differ

 
hexin orsen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi;
jsp page has out instance,but in servlet we can get one out instance by response.getWriter() ;

In servlet ,out is org.apache.catalina.connector.CoyoteWriter instance;
In jsp page ,out is org.apache.jasper.runtime.JspWriterImpl instance;
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi hexin,

As I know in servlets we have two choices for output: characters or bytes
PrintWriter: printing text data to a character stream.



OutputStream:writing any thing else

printwriter actually wraps the ServletOutputStream.


PrintWriter has reference to the ServletOutputStream.

thanks,
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP's out object has most of the same methods returned by the servlets getWriter(), however it adds some buffering capabilities.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic