tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinny <vi...@xaymaca.com>
Subject Re: writing jsp output to a file
Date Tue, 14 Nov 2000 23:32:02 GMT
try this:


<%@ page import="java.io.*" %>
<%


FileWriter tempFile = new FileWriter("/tmp/gold.txt",false);
String data = "To be or not to be";
PrintWriter toFile = new PrintWriter(tempFile);
toFile.println(data);
toFile.close();


%>


this writes "To be or not to be" into /tmp/gold.txt on a unix system

Juan Ramirez wrote:

> I would like to write the output of a jsp file to a static html file
> instead of sending it out to a browser.  I have a pagebuilding system
> that uses the power of jsp to do a lot of things, but I need to write
> the resulting jsp to a file instead of streaming it out.  Has anyone
> done anything like this?
> 
> Thanks.
> 
> Juan


Mime
View raw message