Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server side includes in WebLogic 10 JSP

 
Jeff Strike
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Any ideas or suggestions?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a JSP, use <c:import> or the include directive.
 
Jeff Strike
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this an HTML or a JSP? If an HTML, you need to find out why IIS is deferring to Weblogic. If it's a JSP, then IIS is a non-issue.
 
Jeff Strike
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff Strike wrote:I'm trying to include an html file (located on an IIS server) in a JSP.

How? TellTheDetails. There are many ways to do this.

When I do this in the JSP:
<!-- #include file="/pleaseWait/pleaseWait.html" -->
I get a message saying: pleaseWait is not defined.

Of course. That's not JSP. That's like trying to compile c++ using a Java compiler.

 
Jeff Strike
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

I think I need to find another way to do this....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff Strike wrote: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.
I know what it is. My point was that in a JSP page, passed off to weblogic from IIS, it's not valid.

If you'd take some time to explain, maybe some help could be offered, but you haven't really explained what you're trying to do.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic