struts-user mailing list archives

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

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

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). 

IN JSP: 

<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: http://www.nabble.com/Struts-resources-bundle-question-tp20780100p20780100.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message