I have my IIS 6 server setup to process server side includes.
I have a simple html file that I'm trying to include in the JSP using the following include:
When I use the above line in a JSP I get an error message saying: "pleaseWait is not defined". From an HTML file on the web server it works fine.
The include works in the HTML whether I use file or virtual.
The problem with the include is that it tries to resolve it at compile time and the path is relative to the JSP. The html file is all static and ideally it should be served up by IIS. In the past we've changed the extension to JSP and included the necessary files in whatever app we're working on....the problem with that is we now have 10 different versions out there and not all of them look or work the same way. This is an attempt to standardize the look and centralize the code.
I guess I should have mentioned that we're using IIS and the ISAPI filter for Weblogic.
I'm trying to include an html file (located on an IIS server) in a JSP.
When I do this in the JSP:
<!-- #include file="/pleaseWait/pleaseWait.html" -->
I get a message saying: pleaseWait is not defined.
When I include the exact same line in an html file on the IIS server it works fine so I know that IIS is processing the SSI correctly.
Bear Bibeault wrote:Of course. That's not JSP. That's like trying to compile c++ using a Java compiler.
The #include is an SSI directive for the web server and gets processed by the web server. (In this case IIS) The compiler looks at it as an HTML comment and properly ignores it.
It just dawned on me that the problem here is that the JSP page does return through IIS, even thought the request for the page goes through IIS. After it's compiled it's being served up by WebLogic. I saw dozens of posts saying that this is supposed to work...in reality there's no way it can work as the web server has no chance to evaluate the #include.