Tuesday, 12 June 2012

Parameter values not showing up in message.properties for a Grails/Spring app

So I was troubleshooting why my parameters were not showing up even though i have debugged through the app and I know it is passing it to my messages.properties.

This was originally in my messages.properties

tweetcommendation.negative.3=Wow probably the best experience I've ever had. @{0} shame on you. #tweetcommendation

At first glance, it doesn't seem like a problem, and there are no error messages in the console. I'll give you another 10 seconds. See the problem? It turns out that I have a single quote that needs to be escaped in order for the property {0} to render
The correct message:

tweetcommendation.negative.3=Wow probably the best experience I''ve ever had. @{0} shame on you. #tweetcommendation

No comments:

Post a Comment