i have web application needs show in english , arabic languages. have added 2 separate resource bundles english , arabic. when uses arabic language jstl format <fmt:message key="navigation.welcome"/>
worked fine shows arabic words. when use <fmt:message var="itemlabel" key="navigation.welcome"/>
not worked , shows unicode value of key/value pair. key/value pair stored in unicode follow.
navigation.welcome = أهلا وسهلا!
jsp page below.
<dsp:page> <div id="atg_store_personalnav"> <ul id="atg_store_personalnavitems"> <%-- wish lists link --%> <li class ="${activetab=='wishlist' ? ' active' : ' '}"> <fmt:message var="itemlabel" key="navigation.welcome"/> <fmt:message var="itemtitle" key="navigation_personalnavigation.linktitle"> <fmt:param value="${itemlabel}"/> </fmt:message> <dsp:droplet name="profilesecuritystatus"> <%-- logged in user --%> <dsp:oparam name="loggedin"> <dsp:a id="mywishlist" page="/myaccount/mywishlist.jsp" title="${itemtitle}" iclass="atg_store_navwishlist"> <c:out value="${itemlabel}"/> </dsp:a> </dsp:oparam> <%-- anonymous user or logged in cookie --%> <dsp:oparam name="default"> <dsp:a id="mywishlist" page="/global/util/loginredirect.jsp?error=wishlistnotloggedin" title="${itemtitle}" iclass="atg_store_navwishlist"> <dsp:property bean="sessionbean.values.loginsuccessurl" value="mywishlist.jsp"/> <c:out value="${itemlabel}"/> </dsp:a> </dsp:oparam> </dsp:droplet> </li> </ul> </div> </dsp:page>
var option need used fmt:message later use. can me?
it used display output. default c:out escapes xml special characters such &. adding escapexml="false" solved.
Comments
Post a Comment