BeginMoh
BeginMoh

Reputation: 123

Spring message in form tag doesn't appear correctly

I'm trying to insert a spring:message tag into a form:... tag, here is the code :

<spring:message code="section.Wiki.titleofthearticle" var="intitule"/>
<form:input type="text" placeholder="Introduction " title="${intitule}"
 path="wikiArticleTitle" required="true"/>

and my message properties values is like this :section.Wiki.titleofthearticle=**Intitule de l'article**

but unfortunately my title attribute displayed like this : Intitule de l&#39;article

Is there a way to displayed correctly ?

Upvotes: 1

Views: 1145

Answers (2)

TheByeByeMan
TheByeByeMan

Reputation: 1424

Change :

<spring:message code="section.Wiki.titleofthearticle" var="intitule"/>

To :

<spring:message htmlEscape="false" code="section.Wiki.titleofthearticle" var="intitule"/>

Spring:message docs

Upvotes: 2

Prashant
Prashant

Reputation: 2614

use encoding of message once (there are predefined methods in URLEncoder)

URLEncoder.encode(String s, String esc);

first parameter is String to be translated and second one is character encoding which you want.

Upvotes: 1

Related Questions