You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Colin Foulkes <co...@protegra.com> on 2004/01/20 22:11:34 UTC
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Problem - Trying to hide javascript files in WEB-INF
Posted by Matt Raible <li...@raibledesigns.com>.
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:colin.foulkes@protegra.com]
> Sent: Tuesday, January 20, 2004 2:12 PM
> To: struts-user@jakarta.apache.org
> 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: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Problem - Trying to hide javascript files in WEB-INF
Posted by Hubert Rabago <ja...@yahoo.com>.
What are you trying to do and why are you trying to do it?
When you hide your JSPs under the WEB-INF, it's usually because you don't want
the user to access them directly. With your <script src="xyz.js">, you're
telling the browser to access that file. If you then put it under WEB-INF,
you're telling the server not to serve that file. You can't go both ways.
Anything you place under WEB-INF won't be accessible to the browser/user, and
that includes your .js file.
--- Colin Foulkes <co...@protegra.com> wrote:
> 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: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org