This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes JSP out.write vs out.print Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP out.write vs out.print" Watch "JSP out.write vs out.print" New topic
Author

JSP out.write vs out.print

Sim Kim
Ranch Hand

Joined: Aug 06, 2004
Posts: 268
Hi All,

The translation of JSP file to Java file shows that all the expressions are transformed to out.print() method while all the HTML template text is written using out.write() . Why so ? Any inputs ?
[ June 01, 2008: Message edited by: SIM KIM ]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
Take a look at the relevant APIs.

What do you think the type of a rtexpr would be?
What do you think the type of "template text" would be?

Based on this knowledge which calls in the API would you use?
There is a method print(Object). There is no method write(Object)
write(String) exists however.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP out.write vs out.print