• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there an equivalent of response.write from ASP?  RSS feed

 
Gibson Tang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a JSP equivalent of response.write in ASP where i can write a string back to the http response?
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, there is a PrintWriter.
HttpServletResponse has method getWriter, than you can call
methods from within PrintWriter for example print()

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP provides the "out" writer for you.
There is no need to extract it from the response object.


 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh sorry, I missed that you are talking about JSP. My code is suitable for servlet.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!