Question

I want to show a property of an object in my Jsp page. the problem is that this property is the name of a label in my resource bundle and the only way I know is to use <s:text name="labelname"> but now that it's a property of an object, I don't know how to do this. This is a part of my code, 'brandList' is a list of brand objects and 'brandName' field is name of label. I want something like this

       <s:iterator value="brandList" status="stat">
            <s:text name="<s:property value='brandName'>" />
       </s:iterator>

but this doesn't work. any idea? Thanks in advance.

Was it helpful?

Solution

Try this:

<s:iterator value="brandList" status="stat" var="brandName">
    <s:text name="%{brandName}" />
</s:iterator>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top