|
From: <jue...@we...> - 2003-07-14 14:09:23
|
Alef, I've just browsed your code, and already intended to suggest to refactor = the path matching stuff into a com.interface21.util.PathMatcher or the = like, as it doesn't depend on handler mappings or even servlet classes. = So fine, go ahead! I really welcome more flexible path resolution = options. Guess why SimpleUrlHandlerMapping is called "simple"... ;-) Regarding unified configuration: I actually gave some thoughts to this, = but didn't reach any conclusion. The role of a HandlerMapping is to = resolve a handler (i.e. Controller), while the role of a = MethodNameResolver is to resolve a method within a certain handler (i.e. = MultiActionController). As the latter can also work via explicit = "action" parameter etc, I don't think we should mix these roles. I added a "...*" mapping to AbstractUrlHandlerMapping (thus both = BeanNameUrlHandlerMapping SimpleUrlHandlerMapping) some weeks ago, = mainly to enable a single "/mymulti/*" mappings to a = MultiActionController that can map sub paths like "/mymulti/myactionX" = to its methods then. Previously, one had to repeat all those = method-level mappings one-by-one on the HandlerMapping. Of course, it makes sense to have similar path matching options on both! Juergen -----Original Message----- From: Rod Johnson [mailto:rod...@in...] Sent: Monday, July 14, 2003 3:49 PM To: al...@jt...; spr...@li... Cc: j=FCrgen h=F6ller [werk3AT] Subject: Re: [Springframework-developer] PathMatchingUrlHandlerMapping It certainly would be handy for method name resolution. We need = consistency between these two things. Juergen, did you give any thought to having = one config handle both by default somehow? Regards, Rod ----- Original Message ----- From: "Alef Arendsen (JTeam)" <al...@jt...> To: "'Rod Johnson'" <rod...@in...>; <spr...@li...> Sent: Monday, July 14, 2003 2:50 PM Subject: RE: [Springframework-developer] PathMatchingUrlHandlerMapping > Wait!!! ;-) > > Right now I'm noticing that this functionality would also be verrrry > handy for the methodname resolver... > > So I'll have to abstract the PathMatching stuff into a separate class > (which makes testing even easier probably) and extend (probably) the > PropertiesMethodNameResolver thingy as well... > > So if no objections here, I'll go ahead and do that as wel... > > Alef > > > -----Oorspronkelijk bericht----- > Van: Rod Johnson [mailto:rod...@in...] > Verzonden: Monday, July 14, 2003 3:37 PM > Aan: al...@jt...; spr...@li... > Onderwerp: Re: [Springframework-developer] = PathMatchingUrlHandlerMapping > > > This is very useful functionality. Good work! > > Thanks, > Rod > > ----- Original Message ----- > From: "Alef Arendsen (JTeam)" <al...@jt...> > To: <spr...@li...> > Sent: Monday, July 14, 2003 2:38 PM > Subject: [Springframework-developer] PathMatchingUrlHandlerMapping > > > > Hi all, > > > > Since I work a lot with protected resources and stuff in webapps, = but > > on the other hand want to share and reuse different view across > > multiple protected resources, I've implemented a somewhat more > > advanced UrlHandlerMapping, one that kind of shows the behavior the > > Ant patterns functionality also has, so: > > > > /**/view/listView.jsp for instance would both match on > > /user/view/listView.jsp, but also on /admin/view/listView.jsp > > /**/view/listView?.jsp for isntance would both match on > > /user/view/listViewA.jsp but also on /admin/view/listViewB.jsp > > /*view*.jsp for instance would both match on /view.jsp both also on > > /view-employee.jsp and /detailed-view-employee.jsp > > > > I've included the additions and modifications I needed to do. These > > are the following: > > > > *** Addition of PathMatchingUrlHandlerMapping > > This class is extending SimpleUrlHandlerMapping and overrides the > > lookupHandler() method from AbstractUrlHandlerMapping > > *** Modification of AbstractUrlHandlerMapping > > Because from the overriden lookupHandler() method I need to be able = to > > > inspect handlerMap property from the AbstractUrlHandlerMapping, I = made > > > this property protected instead of private > > *** Addition of PathMatchingUrlHandlerMappingTestSuite and map3.xml = to > > > this package which is testing the PathMatchingUrlHandlerMapping > > > > I've been running the Clover stuff and managed to get the coverage = up > > to 87,2%, I hope that's up to standards for you guys? > > > > About the pathmatching principles, they're explained in the JavaDoc = of > > > the class itself. The algorithms are 'borrowed' from the Ant > > SelectorUtils class. I've modified them to use Lists instead of > > Vectors. > > > > It would be nice if you would be able to integrate them. > > > > Cheers, > > > > Alef Arendsen > > > > |