Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Servlets
response.getWriter() out and jsp out differ
hexin orsen
Greenhorn
Posts: 4
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi hexin,
As I know in servlets we have two choices for output:
characters
or
bytes
PrintWriter: printing text data to a character stream.
PrintWriter writer = response.getWriter(); writer.println("some text");
OutputStream:writing any thing else
printwriter actually wraps the ServletOutputStream.
ServletOutputStream out = response.getOutputStream(); out.write(ByteArray);
PrintWriter has reference to the ServletOutputStream.
thanks,
Bosun Bello
Ranch Hand
Posts: 1514
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JSP can't send a binary file
send file to the client/ jspsmart
MySQL data to show on Tomcat
Servlet - PrintWriter error
How write for JSP inclusion?
More...