You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by j alex <st...@gmail.com> on 2007/08/09 18:01:38 UTC

S2 : using resource bundle values containing HTML in ui tags

Hi,

I need to store the label values in the resource bundle ; and to support
screenreaders these values may have some <span> tags

ex : label.primaryapp.firstName=First name<span class="screaderstyle"> of
applicant</span>

Now, in s:label tag ; i'm using using it as :

<s:label value="%{getText('label.primaryNameAndAddress.lastName')}" for="
primaryapp.firstname" theme="mytheme"/>

Note that it's a custom theme with the escaping set to false.

<#if parameters.nameValue?exists>
<@s.property value="parameters.nameValue" escape="false"/><#t/>
</#if>

Please let me know if there's  a better way to do this -- we are migrating
from a Struts 1.x app and have to replace a lot of html:label tags ; so
it'll be good if the code is somewhat concise.

Thanks,
Joseph