Re: Path matching question, again

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Re: Path matching question, again

Les Hazlewood
Hi Tamas,

I agree with you - a pluggable matcher would be much nicer.  Can you please
add that as a Jira feature request?  I'd like to get that in there for RC2,
which, if I'm lucky, I'll get out next week.

Also, if you come up with a url-based matcher that you think is generic
enough for people outside of your needs, we would definitely appreciate a
code contribution :)  (Its ok if you don't feel that would be appropriate,
of course).

Then we could include it in RC2 and you wouldn't have to maintain it

But, for now, there are two things you can do to keep moving until RC2.

1.  For any custom filter you have, override the
PathMatchingFilter.pathsMatch method to use your custom matcher.  Naturally,
the pluggable, interface-driven approach (for the Jira issue you hopefully
will create! ;) ) will allow us to set this once and be applied to all

2.  Override IniWebConfiguration.getChain(request,response,chain) and
copy-n-paste our code, just changing the line:

if (pathMatcher.match(path, requestURI)) {

with your own pathMatcher implementation.

That should do it.

This being said, I'm _really_ surprised that we didn't have this
interface-driven and pluggable from the start.  If you've looked at much
else of our framework, we're pretty religious about interface-driven design
and this should have never occurred.  I apologize for that, but we'll get it
fixed for RC2.



On Wed, Aug 6, 2008 at 1:52 PM, Tamas Cservenak <[hidden email]>wrote:

> Hi Les,
> we are having problems with the AntPathMatcher, it seems to us it does not
> does the right job.
> for example, the Path matcher should match paths, and not URL parts (ie.
> parameters) -- IMO :)
> So, i'd like to ask you what is needed to simply change the behaviour or
> JSec regarding to path matching?
> I see two references -- and that is what borks be -- to AntPathMatcher:
> One is in IniWebConfig, in getChain() method, and the second one is in
> PathMatchingFilter pathsMatch() method.
> With 0.9,0-RC1, what steps are needed to simply avoid the AntPathMacher and
> apply some our custom matcher?
> Anyway, it would be nice to see in future releases that Path matching is
> made pluggable and left to end users to apply whatever they like :)
> ~t~