<%@taglib uri="http://jakarta.apache.org/taglibs/io-1.0" prefix="io" %> <%@page import="java.io.*"%> <%-- Serves up a HTTP request (the Jakarta home page) i.e. a proxy --%>

File Write demo

Create a temporary file

<% File file = File.createTempFile( "jakarta-home-", ".html" ); FileWriter fileWriter = new FileWriter( file ); %>

This sample will write the Jakarta home page to a temporary file at:

<%= file.getCanonicalPath() %>

<% fileWriter.close(); %>

Done. File is: <%= file.length() %> bytes long

Now lets read it...