jQuery in Action, 3rd edition
The moose likes I/O and Streams and the fly likes getWriter() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "getWriter() method" Watch "getWriter() method" New topic

getWriter() method

Mahesh Barik

Joined: Aug 14, 2006
Posts: 15
when should we use getWriter() method?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Hi, welcome to the ranch!

Did you find getWriter() on HttpServletResponse? If so, we use that when we want a servlet to write something back to the browser. Once we have the writer we can write HTML or whatever we like.

If you found it somewhere else, the answer will probably be similar, but you'll need to show us where you found it to be sure.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Mahesh Barik

Joined: Aug 14, 2006
Posts: 15
Thanks for your response
I have used in servlet.But my question is :
PrintWriter and System classes both are used for output purpose.
(using println() method)
what are the cases in which each should be used?
I agree. Here's the link: http://aspose.com/file-tools
subject: getWriter() method
It's not a secret anymore!