I have an application using spring-mvc 3.0. The controllers are configured like this:
@RequestMapping(value = "/update", method = RequestMethod.POST)
public ModelAndView updateValues(
@RequestParam("einvoiceId") String id){
...}
When posting an id that contains special characters (in this case pipe |), url-encoded with UTF-8 (id=000025D26A01%7C2014174) the string id will contain %7C. I was expecting spring-mvc to url decode the parameter. I am aware that I can solve this by using
java.net.URLDecoder.decode()
but since I have a large number of controllers, I would like this to be done automatically by the framework.
I have configured the Tomcat connector with URIEncoding="UTF-8"
and configured a CharacterEncodingFilter
, but as I understand it this will only affect GET requests.
Any ideas on how I can make spring-mvc url decode my post parameters?