File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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.
 
Consider Paul's rocket mass heater.
 
subject: JSP out.write vs out.print