• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to write data from PrintWriter stream

 
Mohit Mehta
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In our project we have one already created API which is called from Sevelet and we are passing PrintWriter object from Servlet to that API as follows

PrintWriter out = resp.getWriter();

objName.doStuff(a,b,out)

Now internally this method doStuff() writes result in form of
out.println("aaaaa");
and control comes back to Servlet now Servlet forwards request,response to
JSP page where We are doing some pagination and other activity and we need to show result written in PrintWriter stream by doStuff() method.

How can we read and show data written in PrintWriter to our JSP page?
Is there any other way to read PrintWriter stream content in JSP?

Regards,
Mohit.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What leads you to think that you need to "read" from a writer in order to re-emit it?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!