struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From riya <>
Subject Struts resources bundle question
Date Mon, 01 Dec 2008 20:42:13 GMT

I am one month old to struts. I was curious to know if sth like below is

I know for sure that following is correct:

label.xx.value = Selected xx product
label.yy.value = Does your product need an accessory 
label.zz.value = Want to return it? 

Please notice that messages are very different though key names differ on
only middle value (i.e. xx/yy/zz). 


<logic:equal property="strProdType" name="products" value="xx">
<bean:message bundle="myBundle" key="label.xx.value" /></logic:equal>
<logic:equal property="strProdType" name="products" value="yy"><bean:message
bundle="myBundle" key="label.yy.value" /></logic:equal>
<logic:equal property="strProdType" name="products" value="zz"><bean:message
bundle="myBundle" key="label.zz.value" /></logic:equal>

Instead of writing so many lines, can I do something like this: 

<bean:message bundle="myBundle" key="label.${productType}.value" />

I am not sure about the syntax though.  But what I intend to know here is,
can I pick label.xx.value/label.yy.value/label.zz.value based on
productType?  ProductType can be xx, yy or zz and can come as bean property.

Please clarify my doubt. Thanks in advance!!

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message