struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hassan Schroeder" <>
Subject Re: including a JavaScript present on my hard disk
Date Wed, 01 Aug 2007 21:28:42 GMT
On 8/1/07, Pierre Goupil <> wrote:

> I have a very simple question to ask : how do I include a JavaScript file in
> a Struts JSP ? I mean : I know how to include it from the Web but I would
> like to download it and include it from my hard disk

> But unfortunately, if I put a direct link to my hard disk, it displays it,
> instead of just including it into my page for me to be able to call it. The
> same applies if the script directive is in the head of my document, FYI.

If I understand your use case, not guaranteed :-), something like this
using JSTL would probably be your best bet.

<script type="text/javascript">
  <c:import url="file:/home/example/snippet.js"/>

Depending on what you're trying to do with the JS, you might run into
some cross-site-scripting problems...

Hassan Schroeder ------------------------

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message