don't understand ur need, why r u placing somefiles on a different machine? is that a different web application running on a different machine??
first of all u can't include a file that is not under ur web application's root directory. if the file that u want to include is a static file like html or even a jsp/servlet/asp..etc then u can't include that file, u can get the output of that jsp/servlet by making a http request on ur own using classes like URL, URLConnection..etc.
Give us some more details about ur actual situation and need for including the file from diff machine, so that we can give some meaningful suggestion.
Note: using FileReader..etc classes for including is a wrong approach, coz u will send the jsp/servlet code to the user not the output of that.
Chandra
GamCom Solutions,
http://www.gamcom.com
(+44(0)208-838-5441
Main Topics
Browse All Topics





by: abuimadPosted on 2003-07-14 at 18:18:53ID: 8921867
If the file is outside of the web application, and is not under another web application, then you need to use a File input stream to read it.
);
Try this:
<%
// Tomcat must be running under a user account that has access permissions to the \\d10601\c$ share
// don't forget to catch IO Exceptions
java.io.FileInputStream in = new FileInputStream( "\\\\d10601\\c$\\try.html"
byte[] fileBytes = new byte[ in.available() ];
in.read( fileBytes );
String fileString = new String( fileBytes );
%>
Of course, you can use the java.io.File and FileReader classes for cleaner code.
Be careful, though, doinf this is really not a good idea because if the d10601 machine is powered off or removed from the network, your code is not going to work.
Good luck