You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Tsang, F (Fred)" <Fr...@rabobank.com> on 2003/12/10 15:03:14 UTC

logic tag using locale

All,

I'm trying to do a bean:write based on the user's current language.
Before you ask, this isn't just internationalization using the
properties files.  I'm displaying item attributes stored in a database,
where there are german and english descriptions.  I know I can set a
bean in my action and access the tag like so:

request.setAttribute("currentLanguage",
getLocale(request).getLanguage());

<logic:equal name="currentLanguage" value="en">
  <bean:write name="product" property="specialFeatures" ignore="true" />
</logic:equal>
<logic:equal name="currentLanguage" value="de">
  <bean:write name="product" property="specialFeaturesDE" ignore="true"
/>
</logic:equal>

is there a bean for locale by default which removes the need to set the
currentLanguage bean I have above?  something like:

<logic:equal name="userlocale" value="en">
  <bean:write name="product" property="specialFeatures" ignore="true" />
</logic:equal>

Are there any special beans which have default names?  Any help is
appreciated.

cheers,
Fred
_____________________________________________________________

This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. If this email contains an offer, that should be considered as an invitation to treat.
_____________________________________________________________

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