Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on JspWriter&PrintWriter  RSS feed

 
Sandya Bhaskara
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm confused...
page 132 HFS-use write() when you get ServletOutputStream from response and use print()/println() when u get a PrintWriter

but in page 293..when JSP becomes servlet...
the example shows..
out.write(....);
out.print(...);
(The container converts JSP to a servlet-here out is a JspWriter similar to the PrintWriter object we get from response)


From Java I/O i understand that u do have write() method in API for PrintWriter...but why cant we use it when we get a PrintWriter object for response ??why HFS states that we should use should use only println()for PrintWriter?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!