It's not a secret anymore!
The moose likes JSP and the fly likes Appliation Server - HTML Include Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Appliation Server - HTML Include" Watch "Appliation Server - HTML Include" New topic

Appliation Server - HTML Include

Prakash Nathan

Joined: Sep 11, 2005
Posts: 6

I am using Jboss-4 application server in my local server.
I would like to include a HTML file which is placed outside the web application (eg: sample.war) in a JSP.

im using the following to include the HTML file
<jsp:include page='<%=filepath%>'/>

The issue is filepath is considered with reference to the application
if filepath=/html/static/temp.html
then JSP include tag is considering path as /sample/html/static/temp.html

But the structure for the HTML file is C:/html/static/temp.html ( local hard disk )

How to include the HTML file in such case?
Please help.

Prakash A
Joan Horta Tosas
Ranch Hand

Joined: Feb 01, 2007
Posts: 59
You cannot include anything from outside your webapp. You can copy the file into your webapp or use a frame/iframe in the html code generated by your JSP to include that page.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63343

Well, I wouldn't consider an iframe an "include". It's a separate page that just happens to be embedded within the window of the first.

And even with an iframe, the HTML file needs to be web accessible.

If the HTML file is web accessible through another web app, you could use the JSTL <c:import> to include it.

But as Joan pointed out, this is best handled at build-time by copying the HTML file to within the bounds of the addressing web application.
[ March 23, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Appliation Server - HTML Include
It's not a secret anymore!