This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Appliation Server - HTML Include" Watch "Appliation Server - HTML Include" New topic
Author

Appliation Server - HTML Include

Prakash Nathan
Greenhorn

Joined: Sep 11, 2005
Posts: 6
Hi

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
example:
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.

Regards
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
Marshal

Joined: Jan 10, 2002
Posts: 60756
    
  65

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: http://aspose.com/file-tools
 
subject: Appliation Server - HTML Include
 
Similar Threads
Serving Content from Outside the context
What is the differences between 2 includes of JSP?
Accessing resources out of context
include and file path
Problem in sequence of actions in JSP