1

My problem is when I use the character ', Thymeleaf converts it to '.

I need to show the apostophes instead.

My string is saved in SQL like this:

"body" : "L'' autorizzazione di EUR [[${ #numbers.formatDecimal(#strings.replace(amount,'','',''.''),1,''POINT'',2, ''COMMA'')}]] in [[${date}]] ore [[${time}]] c/o presso [[${merchant}]] รจ stata negata. [[${ #strings.replace(refuseMessage,'',/'/g)}]]"

I tried string.replace but it doesn't work. Can somebody help me please?

Sonn
  • 89
  • 8
  • What is `haskell-thyme`? I think that tag has nothing to do with your question. โ€“ andrewJames Jul 29 '22 at 15:53
  • What does "_it doesn't work_" mean? Do you get an error? If so, what is the error? (Add the complete text of any errors to your question.) What do you _expect_ to see? Add that to the question as well. โ€“ andrewJames Jul 29 '22 at 15:55
  • Show us how you are trying to display your string in an actual Thymeleaf template, or at the very least, a Thymeleaf-enabled tag. Add that to the question, as well. โ€“ andrewJames Jul 29 '22 at 15:56

1 Answers1

0

Are you creating HTML? Then ' is correct, and you don't need to replace it.

If you are not creating HTML, then you need to make sure your template resolver is set to an appropriate template mode, for example, TEXT:

 templateResolver.setTemplateMode(TemplateMode.TEXT);
RoToRa
  • 37,635
  • 12
  • 69
  • 105