Hey!

Woah!  Mina you want to send a file back to your browser.  Well a couple
of items are necessary.

Your servlet container must support this with a file servlet.
You need to roll your own software to stream back the file
data.

A good example on how to do this is included in Jason Hunter's book.
You can check this E-list's archive for details on how to buy his book
and get use of his software.

BTW, you can send more than just text files.  Spread sheets, word docs, images
etc.  Your browser need to be able to launch applications though.  Netscape
works and don't use IE so I can't say.

Sans adieu,
Danny Rubis

"[Mina Gohari]" wrote:

>      Hi to all professional
>
>      I use from Apache and NT as server , I wrote a servlet that this
>      servlet read from a txt file , It said that FileNotFoundException ,
>      Why? please answer me.
>
>      Thanks in advance.
>
>      try {
>            File inputFile = new File("http://localhost:8000/Head.txt");
>            in = new FileReader(inputFile);
>            while ((c = in.read()) != -1)
>              HTMLBuffer.append((char) c);
>            in.close();
>          }
>      catch (IOException ioe) {
>            HTMLBuffer.append(ioe.toString());
>          }
>
>      Mina
>
> ___________________________________________________________________________
> 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

Reply via email to