I recently upgraded my app from Spring 2.5.6 to Spring 3.0.0. A few days later, I noticed that some of my pages were no longer functional. The problem appears to be my UserContent.do controller.
UserContent.do is mapped using the SimpleUrlHandlerMapping
mapping. It looks like this:
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/*/UserContent.do">UserContentController</prop>
</props>
</property>
</bean>
The problem is that I allow user-generated content in that middle directory, so those URLs could be anything:
http://mysite.com/foo/UserContent.do
http://mysite.com/bob/UserContent.do
http://mysite.com/foo%0a%0dbob/UserContent.do
It's that third case that is the problem. For some reason, it appears that "\r\n" no longer matches * in Spring 3. It seems like it still works in Spring 2.5.6.
I plan on no longer allowing users to enter newline characters into that spot. It was an oversight to begin with. However, I'd like those URLs to keep working for SEO reasons. Is there a way I can map a URL with a URL encoded newline in it somehow in Spring 3?