You can do something like this on your servlet:
PrintWriter out = response.getWriter();
BufferedReader buf = new BufferedReader(new
FileReader(request.getContextPath() + "/" + fileName));
String htmlBuf = "";
while ((htmlBuf = buf.readLine())!=null) {
out.println(htmlBuf);
}
out.flush();
out.close();
buf.close();
Regards,
-Wayan-
-----Original Message-----
From: Alex Kachanov [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 3:00 PM
To: [EMAIL PROTECTED]
Subject: how to include static file into servlet?
instead of typing all those out.println()
I just want to include into servlet
a static file which contains a huge peice of html code
how can I do this?
with best wishes
Alexander Kachanov
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html