How can I to make a connection to the server and retrieve the file if the
file I am trying to open is not in the same machine ?


>From: Andras Balogh <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
>        Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: How to open a file using Web Address ?
>Date: Tue, 12 Oct 1999 09:14:34 +0200
>
>Hi,
>
>
>     You have to use an absolute path to the file
>not an url.
>     Maybe You are thinking that this way the servlet
>will be portable. Instead of your aproach you can
>have an init parameter that describes the full path minus the filename
>and i thing you can retrieve the init parameter with:
>
>String pathtofile=getServletConfig().getInitParameter("filepath");
>
>    If the file you are trying to open is not in the same machine than
>you have to make a connection to the server and retrieve the file but i
>think this will be
>to slow for a servlet ( i mean the request from the client times out).
>
>
>   ----- Original Message -----
>   From: Hartono (Telebot)
>   To: [EMAIL PROTECTED]
>   Sent: Monday, October 11, 1999 3:29 PM
>   Subject: How to open a file using Web Address ?
>
>
>   Hi ...
>
>   I want to open an HTML file using a servlet, so I didn't have to code
>the HTML in my servlet !
>   Currently I'm using the path to my C: drive like the following lines !!
>
>       FileObject endObj = new
>FileObject("C:\\servlet\\PostingJob\\end.html");
>
>
>   But when I changed the referenced like :
>
>       FileObject endObj = new
>FileObject("http://localhost:8000/servlet/PostingJob/main.html");
>
>   The servlet cannot open the file and give me an exception ???
>
>   any body know how to do this ??
>
>   any help would very appreciated !!
>
>   regards,
>   Hartono sutirman
>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

___________________________________________________________________________
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