Spring MVC (3.0) considers URLs with and without trailing slashes as the same URL.
For example:
http://www.example.org/data/something = http:
I think you best option would be to do this before entering in Spring web's servlet, using UrlRewriteFilter. This will ensure that your redirect rules would not impact your controllers.
Please note that you write the rules in your .war project, not in an apache with mod_rewrite.
Go here for the library's project on googlecode.
in the urlrewrite.xml write :
Remove trailing slash
^(.*)/$
$1
In the web.xml of your application, add :
UrlRewriteFilter
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
confPath
/WEB-INF/urlrewrite.xml
UrlRewriteFilter
/*
REQUEST
Beware, the declaration order of the filters in the web.xml is important, so try to declare this one before anything from spring.
Of course, this is but a fraction of what UrlRewriteFilter can do.
Regards.