0

I have some trouble with Spring HTTP message conversion. In my app I have the login form. When registered user try to login he get the login error ( redirect to /login?login_error=1) The actual input username is ¡¢£¤¥¦§¨©ª«¬­®¯°±²³

The request content is http://bit.ly/oCmwwP

The UsernamePasswordAuthenticationFilter get as input parameter the miscoded username.

For example, the expected username (encoded ¡¢£¤¥¦§¨©ª«¬­®¯°±²³) is %C2%A1%C2%A2%C2%A3%C2%A4%C2%A5%C2%A6%C2%A7%C2%A8%C2%A9%C2%AA%C2%AB%C2%AC%C2%AD%C2%AE%C2%AF%C2%B0%C2%B1%C2%B2%C2%B3

But the actual input data is A?A?A?A¤A?A¦A§A?A©A?A«A¬A­A®A?A°A±A?A?

Also you may see it on the debugger screenshot http://bit.ly/qIWFLj

I think the problem may be with Spring message converter for the "application/x-www-form-urlencoded" content. I couldn't find what converter made such conversion for the input data.

I'm using Apache Tomcat Version 6.0.26.

web.xml - bit.ly/ph0t7j

Thank you for your time. I would really appreciate for any help

senleft
  • 483
  • 1
  • 4
  • 17
  • Take a look at this answer it might help : http://stackoverflow.com/questions/6638284/spring-mvc-response-encoding-issue/6644019#6644019 – ant Oct 19 '11 at 11:46

1 Answers1

1

I have solved this issue.

Solution

I have moved the encoding-filter in the web.xml to the first place in the filter chain.

senleft
  • 483
  • 1
  • 4
  • 17