Maybe I didn't understand you right, but if you want to
write text from a file in your HTML response, can't you
just read the file using a fileInputStream, and then
output each line to the client?
something like
FileInputStream stream = new FileInputStream("CompanyData");
BufferedReader reader = new BufferedReader(stream);
PrintWriter out = new PrintWriter(responset.getOutputStream());
String line = "";
while ((line = reader.readLine) != null)
{
out.println(line);
}
--Monte Glenn Gardner
On Wed, 8 Aug 2001, BENARD Christophe, DDE 34/SG wrote:
> Hi gurus,
>
> Maybe I'm taking the bad way to do it, but what I want to do is to include a
> header file (which displays the name of the company, the date, the name of
> the user, etc) in a page generated by a servlet.
>
> If I try to input the file using a out.println("<%@ include
> file='TheNameOfMyHeaderFile.jsp'%>").
>
> The result is a page which display <%@ include
> file='TheNameOfMyHeaderFile.jsp'%> at the top of my "servlet" page. I can
> easily imagine why it doesn't work, but I don't know any better way to do
> it.
>
> Any idea or suggestion would be appreciated.
>
> TIA
>
> Chris
>
> ___________________________________________________________________________
> 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