You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Wegner <ma...@yahoo.com> on 2005/01/27 06:59:53 UTC
WEB-INF and non-JSP files
I recently saw a post about moving all web app files underneath the
WEB-INF directory. Unfortunately the search mechanism on the Struts web
site appears to be unavailable and I can't find those emails.
So I understand why some would put Javascript, JSP, images, etc. under
WEB-INF. But if you do that, how do you access it? What is the Struts
trick to get the container to send non-JSP files underneath WEB-INF?
Thanks.
--Marty
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: WEB-INF and non-JSP files
Posted by Martin Wegner <ma...@yahoo.com>.
Right. But what about non-JSP files under WEB-INF? Is there a trick to
getting Struts to access them? Or is there no point in putting non-JSP
files under WEB-INF?
--Marty
--- Dakota Jack <da...@gmail.com> wrote:
> All Struts Actions can access jsps within WEB-INF. I put everything
> except the index page there, and my index page is merely a forward.
>
> Jack
>
>
> On Wed, 26 Jan 2005 21:59:53 -0800 (PST), Martin Wegner
> <ma...@yahoo.com> wrote:
> >
> > I recently saw a post about moving all web app files underneath the
> > WEB-INF directory. Unfortunately the search mechanism on the Struts
> web
> > site appears to be unavailable and I can't find those emails.
> >
> > So I understand why some would put Javascript, JSP, images, etc. under
> > WEB-INF. But if you do that, how do you access it? What is the
> Struts
> > trick to get the container to send non-JSP files underneath WEB-INF?
> > Thanks.
> >
> > --Marty
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> ------------------------------
>
> "You can lead a horse to water but you cannot make it float on its
> back."
>
> ~Dakota Jack~
>
> "You can't wake a person who is pretending to be asleep."
>
> ~Native Proverb~
>
> "Each man is good in His sight. It is not necessary for eagles to be
> crows."
>
> ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
>
> -----------------------------------------------
>
> "This message may contain confidential and/or privileged information.
> If you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action based
> on this message or any information herein. If you have received this
> message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: WEB-INF and non-JSP files
Posted by Dakota Jack <da...@gmail.com>.
All Struts Actions can access jsps within WEB-INF. I put everything
except the index page there, and my index page is merely a forward.
Jack
On Wed, 26 Jan 2005 21:59:53 -0800 (PST), Martin Wegner
<ma...@yahoo.com> wrote:
>
> I recently saw a post about moving all web app files underneath the
> WEB-INF directory. Unfortunately the search mechanism on the Struts web
> site appears to be unavailable and I can't find those emails.
>
> So I understand why some would put Javascript, JSP, images, etc. under
> WEB-INF. But if you do that, how do you access it? What is the Struts
> trick to get the container to send non-JSP files underneath WEB-INF?
> Thanks.
>
> --Marty
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
------------------------------
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
-----------------------------------------------
"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: WEB-INF and non-JSP files
Posted by Martin Wegner <ma...@yahoo.com>.
Thanks!
--- Kishore Senji <ks...@gmail.com> wrote:
> The primary purpose of storing JSP's under WEB-INF/ is to prevent user
> to access them directly instead of going to an Action which might be
> setting something which is required for the workflow, Authentication,
> Authorization etc. which avoids putting that sort of logic in the JSP
> itself. I don't see any reason why we shouldn't allow direct access
> to the css, js, image files. So, I think it's better to leave them
> (js, css, images) outside of the webapp.
>
> If you still want to have everything inside WEB-INF/ here is a an
> example
> http://www.michaelmcgrady.com/eschew_url.jsp
>
>
> On Wed, 26 Jan 2005 21:59:53 -0800 (PST), Martin Wegner
> <ma...@yahoo.com> wrote:
> >
> > I recently saw a post about moving all web app files underneath the
> > WEB-INF directory. Unfortunately the search mechanism on the Struts
> web
> > site appears to be unavailable and I can't find those emails.
> >
> > So I understand why some would put Javascript, JSP, images, etc. under
> > WEB-INF. But if you do that, how do you access it? What is the
> Struts
> > trick to get the container to send non-JSP files underneath WEB-INF?
> > Thanks.
> >
> > --Marty
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: WEB-INF and non-JSP files
Posted by Kishore Senji <ks...@gmail.com>.
The primary purpose of storing JSP's under WEB-INF/ is to prevent user
to access them directly instead of going to an Action which might be
setting something which is required for the workflow, Authentication,
Authorization etc. which avoids putting that sort of logic in the JSP
itself. I don't see any reason why we shouldn't allow direct access
to the css, js, image files. So, I think it's better to leave them
(js, css, images) outside of the webapp.
If you still want to have everything inside WEB-INF/ here is a an example
http://www.michaelmcgrady.com/eschew_url.jsp
On Wed, 26 Jan 2005 21:59:53 -0800 (PST), Martin Wegner
<ma...@yahoo.com> wrote:
>
> I recently saw a post about moving all web app files underneath the
> WEB-INF directory. Unfortunately the search mechanism on the Struts web
> site appears to be unavailable and I can't find those emails.
>
> So I understand why some would put Javascript, JSP, images, etc. under
> WEB-INF. But if you do that, how do you access it? What is the Struts
> trick to get the container to send non-JSP files underneath WEB-INF?
> Thanks.
>
> --Marty
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: WEB-INF and non-JSP files
Posted by Dakota Jack <da...@gmail.com>.
<snip>
On Thu, 27 Jan 2005 18:51:35 -0600, Will Stranathan
<wi...@thestranathans.com> wrote:
> If I remember the same thread, I think the thrust of the argument was
> that JSP belongs under WEB-INF because it's TEMPLATE artifacts, NOT
> web artifacts. However, images and javascripts, unless you have a
> custom servlet or Struts action to retrieve those artifacts, would NOT
> belong under WEB-INF - those are specific to presentation.
</snip>
Where you put the files, Will, has little, I think, to do with any
architecture. Rather, the issue is accessibility. If you want only
programmatic accessibility, you want to do something to ensure that a
URL cannot reach your assets. These assets can be anything: images, a
phone book, JSP pages, etc. I put everything there. No reason not to
in my case.
Jack
--
------------------------------
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
-----------------------------------------------
"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: WEB-INF and non-JSP files
Posted by Martin Wegner <ma...@yahoo.com>.
Will,
That sounds right. Thanks for the summation.
--Marty
--- Will Stranathan <wi...@thestranathans.com> wrote:
> If I remember the same thread, I think the thrust of the argument was
> that JSP belongs under WEB-INF because it's TEMPLATE artifacts, NOT
> web artifacts. However, images and javascripts, unless you have a
> custom servlet or Struts action to retrieve those artifacts, would NOT
> belong under WEB-INF - those are specific to presentation.
>
> w
>
> On Wed, 26 Jan 2005 21:59:53 -0800 (PST)
> Martin Wegner <ma...@yahoo.com> wrote:
> >
> >I recently saw a post about moving all web app files underneath the
> >WEB-INF directory. Unfortunately the search mechanism on the Struts
> >web
> >site appears to be unavailable and I can't find those emails.
> >
> >So I understand why some would put Javascript, JSP, images, etc.
> >under
> >WEB-INF. But if you do that, how do you access it? What is the
> >Struts
> >trick to get the container to send non-JSP files underneath WEB-INF?
> >
> >--Marty
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: WEB-INF and non-JSP files
Posted by Will Stranathan <wi...@thestranathans.com>.
If I remember the same thread, I think the thrust of the argument was
that JSP belongs under WEB-INF because it's TEMPLATE artifacts, NOT
web artifacts. However, images and javascripts, unless you have a
custom servlet or Struts action to retrieve those artifacts, would NOT
belong under WEB-INF - those are specific to presentation.
w
On Wed, 26 Jan 2005 21:59:53 -0800 (PST)
Martin Wegner <ma...@yahoo.com> wrote:
>
>I recently saw a post about moving all web app files underneath the
>WEB-INF directory. Unfortunately the search mechanism on the Struts
>web
>site appears to be unavailable and I can't find those emails.
>
>So I understand why some would put Javascript, JSP, images, etc.
>under
>WEB-INF. But if you do that, how do you access it? What is the
>Struts
>trick to get the container to send non-JSP files underneath WEB-INF?
>
>--Marty
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org