Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL: c:import - java script include issue

 
Prakash Nathan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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?

Thanks
Prakash A
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic