File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSTL: c:import - java script include issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL: c:import - java script include issue" Watch "JSTL: c:import - java script include issue" New topic

JSTL: c:import - java script include issue

Prakash Nathan

Joined: Sep 11, 2005
Posts: 6

My application is deployed in JBoss application server.
I need to include a HTML file ( which is present in different apache server ) into the JSP.

Im using the following jsp snippet to accomplish the same.

<c:import url="--apache server html file path--"/>

Here is where i need help..

The HTML file has few java script includes of the following type.
<script language="JavaScript" src="../../../globalscript.js"> </script>

The java script files resides in Apache server.
Im not able to give absolute url to include javascript due to other issue.

But when i import the HTML, the app server is searching for java script files in JBoss environment and not in Apache environment.Hence, the scripts files are not properly included.

Is there any way to include java scripts in such case?

Prakash A
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63838

This has little to do with the import. When the HTML is sent to the browser, the browser will look for the JavaScript files wherever the script directives say. So if they are on a different server than that which served the page, you have no option but to use the full and absolute URL.

If you have persmission to be importing the content, you should also have permission to copy the JavaScript files to your local server. If you don't have permission, well...

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JSTL: c:import - java script include issue
It's not a secret anymore!