• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.getWriter() out and jsp out differ

 
hexin orsen
Greenhorn
Posts: 4
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic