You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Security Management <li...@secmgmt.com> on 2009/04/22 16:17:54 UTC
Disable GET site-wide
Is there any way to prevent struts 2 from processing GET parameters? I have
my application to only use POST forms, so the values are not visible in the
URL, is there a way to have struts not call setters for the
http://host/myapp/delete_person?id=12345, and only set it for the action if
it's submitted via POST?
I'm thinking this is done by the ActionMappingParametersInterceptor, but I
don't see a way to only make it set parameters for POST, and to ignore GET.
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Disable GET site-wide
Posted by Wes Wannemacher <we...@wantii.com>.
Why not write another interceptor and place it early in your stack?
Disabling all GET requests seems a bit overzealous though, GET is used
by so much more than form submission. I would say to inherit from
MethodFilterInterceptor and then perform whatever logic you want to
perform when you see a non-POST invocation of the execute method
(assuming execute is the method you use to handle form submission).
-Wes
On Wed, Apr 22, 2009 at 10:17 AM, Security Management
<li...@secmgmt.com> wrote:
> Is there any way to prevent struts 2 from processing GET parameters? I have
> my application to only use POST forms, so the values are not visible in the
> URL, is there a way to have struts not call setters for the
> http://host/myapp/delete_person?id=12345, and only set it for the action if
> it's submitted via POST?
>
> I'm thinking this is done by the ActionMappingParametersInterceptor, but I
> don't see a way to only make it set parameters for POST, and to ignore GET.
>
> Thanks.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org