wood burning stoves 2.0*
The moose likes Servlets and the fly likes response.getWriter() out and jsp out differ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "response.getWriter() out and jsp out differ" Watch "response.getWriter() out and jsp out differ" New topic
Author

response.getWriter() out and jsp out differ

hexin orsen
Greenhorn

Joined: Aug 14, 2009
Posts: 4
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

Joined: Dec 21, 2006
Posts: 197
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

Joined: Nov 06, 2000
Posts: 1510
The JSP's out object has most of the same methods returned by the servlets getWriter(), however it adds some buffering capabilities.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: response.getWriter() out and jsp out differ
 
Similar Threads
MySQL data to show on Tomcat
Servlet - PrintWriter error
How write for JSP inclusion?
send file to the client/ jspsmart
JSP can't send a binary file