Yes, I overlooked the caching aspect. Thanks for your help.
Colin -----Original Message----- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: January 20, 2004 3:28 PM To: 'Struts Users Mailing List' Subject: RE: Problem - Trying to hide javascript files in WEB-INF You could include it (<jsp:include>), but then you'd lose the browser's ability to cache the script and you'd end up with a bunch of JavaScript in your page. The "best practice" is to put your scripts in a place where browsers can get at them. If, for some reason, you don't want folks looking at your script - there's probably something you need to remove. Matt > -----Original Message----- > From: Colin Foulkes [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 20, 2004 2:21 PM > To: Struts Users Mailing List > Subject: RE: Problem - Trying to hide javascript files in WEB-INF > > > Yes, > > I understand what's happening, but I'm not sure whether there > is an alternative approach to placing the .js content into > the jsp at the server side. > > Thanks > > Colin > > -----Original Message----- > From: Matt Raible [mailto:[EMAIL PROTECTED] > Sent: January 20, 2004 3:15 PM > To: 'Struts Users Mailing List' > Subject: RE: Problem - Trying to hide javascript files in WEB-INF > > > Anything that the client will access, i.e. .js or .css files > via "href" attributes needs to be exposed to them. I usually > put my scripts in a "scripts" folder and my stylesheets in a > "styles" folder. > > > -----Original Message----- > > From: Colin Foulkes [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, January 20, 2004 2:12 PM > > To: [EMAIL PROTECTED] > > Subject: Problem - Trying to hide javascript files in WEB-INF > > > > > > Hi, > > > > I'm quite new to Open source and Struts > > > > I'm trying to convert some Microsoft asp.net pages to a > > struts/apache environment; and following advice on the > > newgroup, have "hidden" my .jsp pages in directories > beneath /WEB-INF. > > > > However, I have some pages that include script tags for > > loading javascript files. When I place the .js files under > > the WEB-INF directory they are not accessible to my page. > > > > The jsp page contains... > > <script src=/WEB-INF/scripts/XXX.js> > > The output window for local host access (under netbeans ide) > > shows the following... "GET /WEB-INF/scripts/XXX.js > HTTP/1.1" 404 720 > > > > If I move the scripts directory out from under WEB-INF, the > > page loads fine, the log shows the following "GET > > /scripts/XXX.js HTTP/1.1" 304 - > > > > > > Is there a way to do this? To hide javascript files under > > WEB-INF and access them from the jsp pages? > > > > Thanks in advance, > > > > Colin > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]