This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes Serving Content from Outside the context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Serving Content from Outside the context" Watch "Serving Content from Outside the context" New topic
Author

Serving Content from Outside the context

ruchi thakur
Greenhorn

Joined: Jun 28, 2007
Posts: 11
Hi

I am using Jboss-4.0.5 application 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=C:/html/static/temp.html
then JSP include tag is considering path as /sample/C:/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
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9343
    
111

Is this of any help?


[My Blog] [JavaRanch Journal]
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
You could use the <c:import> tag which is part of the JSTL.
With this tag you could access outside the container.

Maybe the following link will help Difference between jsp:include and c:import


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
ruchi thakur
Greenhorn

Joined: Jun 28, 2007
Posts: 11
Thank In tonnss!!
<c:import> worked for me
Regards,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Serving Content from Outside the context
 
Similar Threads
What is the differences between 2 includes of JSP?
include and file path
Appliation Server - HTML Include
Accessing resources out of context
Problem in sequence of actions in JSP