-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I've been using the Handler/Interceptor feature of Spring MVC and I
really like it. I'd like to propose an enhancement to it that I think
will make it more flexible and easier to configure in the *-servlet.xml
file.
Right now, you must specify a new HandlerMapping class when you want to
create different combinations of Interceptors.I'd like to propose that
Interceptor -> Handler binding is done more like Filters and outside of
the HandlerMapping class.
One solution would be an InterceptorMapping class, which is configured
like a HandlerMapping class. It could contain a map of URIs to
interceptors. This InterceptorMapping class would be given to the
HandlerMapping class. The HandlerMapping class then calls something
like interceptorMapping.findInterceptors(servletRequest) when it's ready
to build a HandlerExecutionChain.
This would allow for all Handlers to use BeanNameHandlerMapping (or a
single HandlerMapping), but be configured with different Interceptors.
The binding of which Interceptor to be applied to which Handler is now
not part of the HandlerMapping. This cuts down on the number of
HandlerMappings to specify and configure, especially in high-Interceptor
usage scenarios.
Thoughts? Comments? If this is unclear, please let me know. Also, if
there's a better way to do this with existing code, then even better. :)
Mahalo!
Seth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFA06veKZsFSwtW+wIRAm+/AJ4hW4eVNWZgoZfe0Mk/WaBzhzZgXACfV1zP
O5hGTiOJRmxYO+mfntWlHOE=
=0RPV
-----END PGP SIGNATURE-----
|