Hello Martin,
+1
I think it must work at standard struts way -
<bean:message name="myBean"/>
<bean:message name="myBean" property="myKeyProperty"/>
and existing one -
<bean:message key="myForm"/>
Tuesday, June 19, 2001, 9:49:56 AM, you wrote:
MC> I posted this a few weeks ago as a patch, when it should more properly have
MC> been a proposal. Here, then, is the proposal:
MC> A problem with the current <bean:message> tag is that the only way to
MC> specify the message resource key dynamically is by using a JSP expression.
MC> This leads to the use of the following pattern:
MC> <bean:define id="myKey" name="myForm" property="myKeyProperty"
MC> type="java.lang.String"/>
MC> <bean:message key="<%= myKey %>"/>
MC> An alternative is to have the Action look up the key and set the resulting
MC> string value in the property for use on the JSP page via <bean:write>. This
MC> doesn't feel right, because the responsibility for looking up the
MC> appropriately localized text is then divided between the Action and the JSP
MC> page.
MC> By enhancing the <bean:message> tag to allow it to obtain the message
MC> resource key from a bean property, we can simplify the above example to:
MC> <bean:message name="myForm" property="myKeyProperty"/>
MC> Here, the 'name' and 'property' attributes are used to obtain the message
MC> resource key from a bean. That key is then used as if it had been specified
MC> using the 'key' attribute.
MC> I believe this proposal would enhance the i18n functionality of Struts by
MC> allowing dynamic specification of messages, while delegating the resolution
MC> of the actual message text to the view.
MC> Comments?
MC> --
MC> Martin Cooper
--
Best regards,
Oleg mailto:[EMAIL PROTECTED]