Stephan van Hulst wrote:Can you show us some of the related code, and describe the exact problem that's being caused?
Well my question was mostly general. Am I supposed to encode those characters? I'm wondering this because <c:url> tag does do encoding but doesn't do anything to characters like Ä or Ö.
I've since tinkered with my code and I got everything to work. I did add encoding for those characters. But the code in the JSP is quite ugly. This is how I got the necessary parameters encoded:
So I used URLEncoder.encode() for encoding the parameter. But I couldn't just put it into <c:url> value attribute or the %'s would get encoded. I got around it using <c:set>. This looks way too complicated, though.
And I'm still wondering if it is generally good practice/recommended to encode those characters? Or is what I just did pointless?
In the end the problems I was having weren't due to me not encoding those characters, I think. The problem was that the production Tomcat server needed to be set to UTF-8 by adding URIEncoding="UTF-8" to the Connector tag in server.xml. This fixed it.
But I'm still wondering if I should keep the characters encoded or if its generally ok to have Ä's and Ö's and such in parameters?