You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Catherine Morgan <Ca...@weir-tech.co.uk> on 2003/04/16 16:01:32 UTC
Front Controller - beginer question
I have just started with struts and I am trying to put an application
together.
I have a number of JSPs, some of which are designed to be accessed directly
and some of which are designed to be included in other JSPs.
I want to hide the JSPs (or possibly just the ones that are to be included
in others) so they cannot be accessed directly by the client. I have read
somewhere that they can be put in the WEB-INF directory. Is this the correct
thing to do and if so how do I then get access to them to include them in
another JSP or include them in action-mappings in the struts-config file?
Is there anything else I need to know about protecting JSPs from the client?
Thanks,
Catharine
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Front Controller - beginer question
Posted by David Chelimsky <da...@chelimsky.org>.
I'm a bit new to Struts myself (so any gurus should feel free to correct
my thinking here), but my understanding is that the best practice is to
never link directly to a .jsp, but always link to an ActionForward that
map to ActionMapping. I've got an app set up this way and if you try to
go after the JSPs directly, you get errors because they are looking for
beans that are defined in the Action class. In this case the user is
forwarded to an error page.
Then you can put whatever security you want in the Action and forward
the request to either the JSP the user is going after (if user is
authorized) or an error page that explains that the user is not authorized.
Hope this helps.
David
Catherine Morgan wrote:
>I have just started with struts and I am trying to put an application
>together.
>
>I have a number of JSPs, some of which are designed to be accessed directly
>and some of which are designed to be included in other JSPs.
>
>I want to hide the JSPs (or possibly just the ones that are to be included
>in others) so they cannot be accessed directly by the client. I have read
>somewhere that they can be put in the WEB-INF directory. Is this the correct
>thing to do and if so how do I then get access to them to include them in
>another JSP or include them in action-mappings in the struts-config file?
>
>Is there anything else I need to know about protecting JSPs from the client?
>
>Thanks,
>Catharine
>
>---------------------------------------------------------------------
>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