Actually I am not calling any action class getKeyLable 
 
I try to:
1- Make the s:label tag get a dynamic (Is it poosibel ?!)
2- The above dynamic value must be read from jsp tag ( The s:label is used in a 
tag itself)

~Regards,
~~Alireza Fattahi



On Saturday, 19 October 2013, 15:35, Martin Gainty <mgai...@hotmail.com> wrote:
  
* In this example, a label is rendered. The label is retrieved from a 
ResourceBundle via the key attribute
* giving you an output of 'User Name: Ford.Prefect'. Assuming that i18n message 
userName corresponds
* to 'User Name' and the action's getUserName() method returns 
'Ford.Prefect'<p/>
* <!-- END SNIPPET: exdescription -->
* <pre>
* <!-- START SNIPPET: example -->
* &lt;s:label key="userName" /&gt;
* <!-- END SNIPPET: example -->
* </pre>
* <pre>
* <!-- START SNIPPET: example2 -->
* &lt;s:label name="userName" label="User Name" /&gt;
* <!-- END SNIPPET: example -->
* </pre>
  

what is returned by your Action Class getLabelKey Method


Martin
______________________________________________ 
Verzicht und Vertraulichkeitanmung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.

  



> Date: Sat, 19 Oct 2013 04:23:55 -0700
> From: afatt...@yahoo.com
> Subject: Passing jsp tag attribute to Struts 2 tags
> To: user@struts.apache.org
> 
>  
> Hi,
>  
> I am creating a new tag in jsp, named `RequiredLabel` , but I can not pass 
> tag attribute to struts label ( The css are based on YAML)
>  
> The tag will be used as:
>     <myTag:RequiredLabel name="amount"/>
>  
> The label should be get from struts as it must be localized.
>     <%@tag description="Renders a label with required css and error label" 
>pageEncoding="UTF-8"%>
>     <%@attribute name="name" required="true" %>
>     <%@taglib prefix="s" uri="/struts-tags"%>
>    
>      <!--Here ${name} works fine --> 
>     <p class="ym-message" id="${name}Error" />
>     <!-- Here I can not pass the name to s:label tag -->
>     <s:label key="form.label.%{name}" cssClass="ym-required" />
>  
> I tried `#attr.name` and `#param.name` but none of them worked!
> Do you know any solution ?!
>  
> 
>  
> ~Regards,
> ~~Alireza Fattahi

Reply via email to