wood burning stoves 2.0*
The moose likes JSP and the fly likes Server side includes in WebLogic 10 JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Server side includes in WebLogic 10 JSP" Watch "Server side includes in WebLogic 10 JSP" New topic
Author

Server side includes in WebLogic 10 JSP

Jeff Strike
Greenhorn

Joined: May 19, 2008
Posts: 15
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

Joined: Jan 10, 2002
Posts: 60810
    
  65

In a JSP, use <c:import> or the include directive.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeff Strike
Greenhorn

Joined: May 19, 2008
Posts: 15
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

Joined: Jan 10, 2002
Posts: 60810
    
  65

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

Joined: May 19, 2008
Posts: 15
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

Joined: Jan 10, 2002
Posts: 60810
    
  65

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

Joined: May 19, 2008
Posts: 15
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

Joined: Jan 10, 2002
Posts: 60810
    
  65

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Server side includes in WebLogic 10 JSP
 
Similar Threads
server side includes
requestDispatchers forward-method equal to return???
Ajax and Servlet
How to include a hit counter?
HTML include