Abdullah,
> I have apache 1.3.14 ( with Jserv) and Tomcat 3.2.1
> running in the same machne
> on linux.
> All the html and images are in apache,
> All the Jsp and Servlets are in tomcat
> Here i have one problem .
> I have a jsp called login.jsp which has an include statement like
>
> <%@ include file="http://127.0.0.1/static/msFoot1.html" %>
> or
> <%@ include file="http://abdullah/static/msFoot1.html" %>
>
> when i call this login.jsp , i am getting the following exception
>
> Internal Servlet Error:
>
> org.apache.jasper.compiler.CompileException:
> /usr/local/jakarta-tomcat-3.2.1/webapps/Oilgrains/jsp/
> login.jsp(9,0) Bad file
> argument to include
You only can include files trough the local filesystem :
<%@ include file="/usr/local/html_files/static/msFoot1.html" %>
If you need to include files via a URL, you can use the next code snippet :
<%
//
// URL inclusion
//
String url = "http://server/path/to/file/here"); // Can be any URL
(ftp, http, etc)
try {
URL urlConn = new URL ( url ); // Creates an
object,
URLConnection connURL = urlConn.openConnection(); // then opens the
connection
InputStream inURL = connURL.getInputStream(); // and converts
it to
// an InptuStream
while ( (x = inURL.read()) != -1 ) {
out.print( (char) x );
};
inURL.close();
} catch (MalformedURLException e) {
out.println("<B>" + e + "</B>" );
} catch (IOException e) {
out.println("<B>" + e + "</B>" );
}
}
%>
Perhaps is not the better code, but take as a starting point (BTW, if anyone
has a better one I'll be happy to hear from it !!)
Cheers.
--
Víctor A. Rodríguez ( http://www.bit-man.com.ar)
Telefónica de Argentina - http://www.Telefonica.com.ar
Tel. (54-11) 4333-7305 - Fax: (54-11) 4303-5586 int. 1680
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]