This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Appliation Server - HTML Include

 
Prakash Nathan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic