You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Andreas Joseph Krogh <an...@officenet.no> on 2009/02/27 13:46:54 UTC
Updated versions of servlet-filtes to allow excluding uris from being processed by Struts2
Hi.
I have modified StrutsPrepareAndExecuteFilter, StrutsPrepareFilter and StrutsExecuteFilter to enable excluding of uri-patters. The filter-config is as follows:
<filter>
<filter-name>struts2-prepare</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
<init-param>
<description>Comma separated list of patterns (java.util.regex.Pattern) to be excluded from Struts2-processing</description>
<param-name>excludedPatterns</param-name>
<param-value>/lang/.*,/pages/.*</param-value>
</init-param>
</filter>
Attached is a patch against trunk(revision 747785).
My original plan was to be able to configure this by setting a property specifying the pattern(s) in struts.properties or struts.xml, but nobody proposed a solution for how I could use those properties from the servlet-filters when I asked...
--
Andreas Joseph Krogh <an...@officenet.no>
Senior Software Developer / CEO
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Rosenholmveien 25 | know how to do a thing and to watch |
1414 Trollåsen | somebody else doing it wrong, without |
NORWAY | comment. |
| |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+
Re: Updated versions of servlet-filtes to allow excluding uris from being processed by Struts2
Posted by Andreas Joseph Krogh <an...@officenet.no>.
On Saturday 28 February 2009 00:11:21 Dave Newton wrote:
> Andreas Joseph Krogh wrote:
> > On Friday 27 February 2009 15:04:52 Musachy Barroso wrote:
> >> Hi Andreas, attaching the patch to a jira ticket is the way to go to
> >> make sure we don't forget about it.
> >
> > Updated patch here:
> > https://issues.apache.org/struts/browse/WW-3017
> >
> > After eyeballing the code some more I finally figured out how to use a property configured in struts.xml or struts.properties. So no init-params in servlet-filter-config necessary anymore.
>
> Personally I'd rather use filter init-params for this--just seems like
> it'd be more local to where filter mapping normally takes place.
>
> Plus I don't use struts.properties or struts.xml files too much anymore.
He he, that's the beauty of it is, you *can* still specify it in the filter's init-params like you want. You see, the filter's init-params and the properties defined in struts.properties and struts.xml are merged by Struts2. So setting this as a filter-param like you want works just fine alongside with specifying it in the struts' config-files.
This way we're both happy:-)
--
Andreas Joseph Krogh <an...@officenet.no>
Senior Software Developer / CEO
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Rosenholmveien 25 | know how to do a thing and to watch |
1414 Trollåsen | somebody else doing it wrong, without |
NORWAY | comment. |
| |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Updated versions of servlet-filtes to allow excluding uris from
being processed by Struts2
Posted by Dave Newton <ne...@yahoo.com>.
Andreas Joseph Krogh wrote:
> On Friday 27 February 2009 15:04:52 Musachy Barroso wrote:
>> Hi Andreas, attaching the patch to a jira ticket is the way to go to
>> make sure we don't forget about it.
>
> Updated patch here:
> https://issues.apache.org/struts/browse/WW-3017
>
> After eyeballing the code some more I finally figured out how to use a property configured in struts.xml or struts.properties. So no init-params in servlet-filter-config necessary anymore.
Personally I'd rather use filter init-params for this--just seems like
it'd be more local to where filter mapping normally takes place.
Plus I don't use struts.properties or struts.xml files too much anymore.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Updated versions of servlet-filtes to allow excluding uris from being processed by Struts2
Posted by Andreas Joseph Krogh <an...@officenet.no>.
On Friday 27 February 2009 15:04:52 Musachy Barroso wrote:
> Hi Andreas, attaching the patch to a jira ticket is the way to go to
> make sure we don't forget about it.
Updated patch here:
https://issues.apache.org/struts/browse/WW-3017
After eyeballing the code some more I finally figured out how to use a property configured in struts.xml or struts.properties. So no init-params in servlet-filter-config necessary anymore.
Please consider it for the next release or at least give feedback on what you don't like about it.
Anyway; Comments are welcome.
--
Andreas Joseph Krogh <an...@officenet.no>
Senior Software Developer / CEO
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Rosenholmveien 25 | know how to do a thing and to watch |
1414 Trollåsen | somebody else doing it wrong, without |
NORWAY | comment. |
| |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Updated versions of servlet-filtes to allow excluding uris from
being processed by Struts2
Posted by Musachy Barroso <mu...@gmail.com>.
Hi Andreas, attaching the patch to a jira ticket is the way to go to
make sure we don't forget about it.
thanks
musachy
On Fri, Feb 27, 2009 at 7:46 AM, Andreas Joseph Krogh
<an...@officenet.no> wrote:
> Hi.
> I have modified StrutsPrepareAndExecuteFilter, StrutsPrepareFilter and StrutsExecuteFilter to enable excluding of uri-patters. The filter-config is as follows:
> <filter>
> <filter-name>struts2-prepare</filter-name>
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
> <init-param>
> <description>Comma separated list of patterns (java.util.regex.Pattern) to be excluded from Struts2-processing</description>
> <param-name>excludedPatterns</param-name>
> <param-value>/lang/.*,/pages/.*</param-value>
> </init-param>
> </filter>
>
> Attached is a patch against trunk(revision 747785).
>
> My original plan was to be able to configure this by setting a property specifying the pattern(s) in struts.properties or struts.xml, but nobody proposed a solution for how I could use those properties from the servlet-filters when I asked...
>
> --
> Andreas Joseph Krogh <an...@officenet.no>
> Senior Software Developer / CEO
> ------------------------+---------------------------------------------+
> OfficeNet AS | The most difficult thing in the world is to |
> Rosenholmveien 25 | know how to do a thing and to watch |
> 1414 Trollåsen | somebody else doing it wrong, without |
> NORWAY | comment. |
> | |
> Tlf: +47 24 15 38 90 | |
> Fax: +47 24 15 38 91 | |
> Mobile: +47 909 56 963 | |
> ------------------------+---------------------------------------------+
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org