utf 8 - apostrophe not well interpreted in jsp -
edit : in jsp (that uses utf-8), have :
<input name="username" type="text" placeholder="<%=resourcebundle.getstring("login.username")%>"onblur="this.placeholder = '<%=resourcebundle.getstring("login.username")%>'"
and in properties file have :
login.username=nom d'utilisateur
this property contains apostrophe doesn't cause problem in placeholder causes problem in onblur function : error diplayed in firebug : “missing ; before statement”
i replaced code in .properties file :
login.username=nom d\'utilisateur
so no longer error in firebug. problem that, @ first time in browser world displayed : nom d\'utilisateur, due placeholder. guess use 2 different properties placeholder , on blur :
login.username=nom d'utilisateur login.username.blur=nom d\'utilisateur
and in jsp :
<input name="username" type="text" placeholder=" <%=resourcebundle.getstring("login.username")%>"onblur="this.placeholder = '<%=resourcebundle.getstring("login.username.blur")%>'"
is there better way things ?
Comments
Post a Comment