You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by phillips1021 <bp...@ku.edu> on 2009/03/09 16:00:52 UTC

Struts 2.6.1 key attribute not working as it did in Struts 2.0.11

We are moving some applications from using Struts 2.0.11 to Struts 2.1.6.  In
our applications using Struts 2.0.11 we used the label tag's key attribute
to specify the name, value, label on some of our jsp view pages.  So for
example:

        <s:label key="personBean.firstName" />

would render in the jsp page as:

<tr>
    <td class="tdLabel"><label for="personBean_firstName" class="label">Your
first name:</label></td>
    <td
><label id="personBean_firstName">Bruce</label></td>
</tr>
         
The global-message.properties file has:

    personBean.firstName=Your first name

and the personBean object exists on the value stack and it has a public
getFirstName() method.

After changing to Struts 2.1.6, using the label tag with the key attribute
no longer works as it did when we used Struts 2.0.11.  Now the jsp renders:

<tr>
    <td class="tdLabel"><label for="personBean_firstName" class="label">Your
first name:</label></td>
    <td><label id="personBean_firstName">Your first name</label></td>
</tr>

Instead of showing the value of the personBean.firstName, it shows the value
from the global-message.properties file (Your First Name)

If I use <s:property value="personBean.firstName" /> the
personBean.firstName value (Bruce) does display correctly on the jsp page.  

We can change our use of the label tag with key attribute to the property
tag, but we are wondering if this is a documented change in how the label
tag with key attribute works in 2.1.6 vs 2.0.11 or if this is a bug in
2.1.6.

Thanks for the assistance.

Bruce Phillips
University of Kansas



-- 
View this message in context: http://www.nabble.com/Struts-2.6.1-key-attribute-not-working-as-it-did-in-Struts-2.0.11-tp22413435p22413435.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


Re: Struts 2.6.1 key attribute not working as it did in Struts 2.0.11

Posted by Musachy Barroso <mu...@gmail.com>.
Fixed in trunk.

thanks for reporting.
musachy

On Mon, Mar 9, 2009 at 3:15 PM, Musachy Barroso <mu...@gmail.com> wrote:
> It was broken as a fix to another problem:
>
> https://issues.apache.org/struts/browse/WW-2171
>
> musachy
>
> On Mon, Mar 9, 2009 at 3:06 PM, phillips1021 <bp...@ku.edu> wrote:
>>
>> The personBean's attributes are given values in an ActionSupport class.
>>
>> As I mentioned using <s:property value="personBean.firstName"> shows the
>> value (Bruce) correctly.  This is done in the same jsp as <s:label
>> key="personBean.firstName" > which doesn't show the value (Bruce) correctly
>> but instead shows the value from the global-message.properties file (Your
>> First Name).
>>
>>
>>
>> in your 2.0.11 test where did you populate personBean.firstName with 'Bruce'
>> ?
>> Martin
>>
>> --
>> View this message in context: http://www.nabble.com/Struts-2.6.1-key-attribute-not-working-as-it-did-in-Struts-2.0.11-tp22413435p22416247.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
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Struts 2.6.1 key attribute not working as it did in Struts 2.0.11

Posted by Musachy Barroso <mu...@gmail.com>.
It was broken as a fix to another problem:

https://issues.apache.org/struts/browse/WW-2171

musachy

On Mon, Mar 9, 2009 at 3:06 PM, phillips1021 <bp...@ku.edu> wrote:
>
> The personBean's attributes are given values in an ActionSupport class.
>
> As I mentioned using <s:property value="personBean.firstName"> shows the
> value (Bruce) correctly.  This is done in the same jsp as <s:label
> key="personBean.firstName" > which doesn't show the value (Bruce) correctly
> but instead shows the value from the global-message.properties file (Your
> First Name).
>
>
>
> in your 2.0.11 test where did you populate personBean.firstName with 'Bruce'
> ?
> Martin
>
> --
> View this message in context: http://www.nabble.com/Struts-2.6.1-key-attribute-not-working-as-it-did-in-Struts-2.0.11-tp22413435p22416247.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
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: Struts 2.6.1 key attribute not working as it did in Struts 2.0.11

Posted by phillips1021 <bp...@ku.edu>.
The personBean's attributes are given values in an ActionSupport class.  

As I mentioned using <s:property value="personBean.firstName"> shows the
value (Bruce) correctly.  This is done in the same jsp as <s:label
key="personBean.firstName" > which doesn't show the value (Bruce) correctly
but instead shows the value from the global-message.properties file (Your
First Name).



in your 2.0.11 test where did you populate personBean.firstName with 'Bruce'
?
Martin 

-- 
View this message in context: http://www.nabble.com/Struts-2.6.1-key-attribute-not-working-as-it-did-in-Struts-2.0.11-tp22413435p22416247.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


RE: Struts 2.6.1 key attribute not working as it did in Struts 2.0.11

Posted by Martin Gainty <mg...@hotmail.com>.
in your 2.0.11 test where did you populate personBean.firstName with 'Bruce'
?
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 




> Date: Mon, 9 Mar 2009 08:00:52 -0700
> From: bphillips@ku.edu
> To: user@struts.apache.org
> Subject: Struts 2.6.1 key attribute not working as it did in Struts 2.0.11
> 
> 
> We are moving some applications from using Struts 2.0.11 to Struts 2.1.6.  In
> our applications using Struts 2.0.11 we used the label tag's key attribute
> to specify the name, value, label on some of our jsp view pages.  So for
> example:
> 
>         <s:label key="personBean.firstName" />
> 
> would render in the jsp page as:
> 
> <tr>
>     <td class="tdLabel"><label for="personBean_firstName" class="label">Your
> first name:</label></td>
>     <td
> ><label id="personBean_firstName">Bruce</label></td>
> </tr>
>          
> The global-message.properties file has:
> 
>     personBean.firstName=Your first name
> 
> and the personBean object exists on the value stack and it has a public
> getFirstName() method.
> 
> After changing to Struts 2.1.6, using the label tag with the key attribute
> no longer works as it did when we used Struts 2.0.11.  Now the jsp renders:
> 
> <tr>
>     <td class="tdLabel"><label for="personBean_firstName" class="label">Your
> first name:</label></td>
>     <td><label id="personBean_firstName">Your first name</label></td>
> </tr>
> 
> Instead of showing the value of the personBean.firstName, it shows the value
> from the global-message.properties file (Your First Name)
> 
> If I use <s:property value="personBean.firstName" /> the
> personBean.firstName value (Bruce) does display correctly on the jsp page.  
> 
> We can change our use of the label tag with key attribute to the property
> tag, but we are wondering if this is a documented change in how the label
> tag with key attribute works in 2.1.6 vs 2.0.11 or if this is a bug in
> 2.1.6.
> 
> Thanks for the assistance.
> 
> Bruce Phillips
> University of Kansas
> 
> 
> 
> -- 
> View this message in context: http://www.nabble.com/Struts-2.6.1-key-attribute-not-working-as-it-did-in-Struts-2.0.11-tp22413435p22413435.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
> 

_________________________________________________________________
Windows Live™: Life without walls.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_032009

Re: Struts 2.6.1 key attribute not working as it did in Struts 2.0.11

Posted by Musachy Barroso <mu...@gmail.com>.
I was able to replicate this problem in showcase, I opened a ticket
with your email:

https://issues.apache.org/struts/browse/WW-3029

I am looking into it.
thanks
musachy

On Mon, Mar 9, 2009 at 11:52 AM, Musachy Barroso <mu...@gmail.com> wrote:
> That look like a bug, I will take a look at it.
>
> musachy
>
> On Mon, Mar 9, 2009 at 11:00 AM, phillips1021 <bp...@ku.edu> wrote:
>>
>> We are moving some applications from using Struts 2.0.11 to Struts 2.1.6.  In
>> our applications using Struts 2.0.11 we used the label tag's key attribute
>> to specify the name, value, label on some of our jsp view pages.  So for
>> example:
>>
>>        <s:label key="personBean.firstName" />
>>
>> would render in the jsp page as:
>>
>> <tr>
>>    <td class="tdLabel"><label for="personBean_firstName" class="label">Your
>> first name:</label></td>
>>    <td
>>><label id="personBean_firstName">Bruce</label></td>
>> </tr>
>>
>> The global-message.properties file has:
>>
>>    personBean.firstName=Your first name
>>
>> and the personBean object exists on the value stack and it has a public
>> getFirstName() method.
>>
>> After changing to Struts 2.1.6, using the label tag with the key attribute
>> no longer works as it did when we used Struts 2.0.11.  Now the jsp renders:
>>
>> <tr>
>>    <td class="tdLabel"><label for="personBean_firstName" class="label">Your
>> first name:</label></td>
>>    <td><label id="personBean_firstName">Your first name</label></td>
>> </tr>
>>
>> Instead of showing the value of the personBean.firstName, it shows the value
>> from the global-message.properties file (Your First Name)
>>
>> If I use <s:property value="personBean.firstName" /> the
>> personBean.firstName value (Bruce) does display correctly on the jsp page.
>>
>> We can change our use of the label tag with key attribute to the property
>> tag, but we are wondering if this is a documented change in how the label
>> tag with key attribute works in 2.1.6 vs 2.0.11 or if this is a bug in
>> 2.1.6.
>>
>> Thanks for the assistance.
>>
>> Bruce Phillips
>> University of Kansas
>>
>>
>>
>> --
>> View this message in context: http://www.nabble.com/Struts-2.6.1-key-attribute-not-working-as-it-did-in-Struts-2.0.11-tp22413435p22413435.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
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Struts 2.6.1 key attribute not working as it did in Struts 2.0.11

Posted by Musachy Barroso <mu...@gmail.com>.
That look like a bug, I will take a look at it.

musachy

On Mon, Mar 9, 2009 at 11:00 AM, phillips1021 <bp...@ku.edu> wrote:
>
> We are moving some applications from using Struts 2.0.11 to Struts 2.1.6.  In
> our applications using Struts 2.0.11 we used the label tag's key attribute
> to specify the name, value, label on some of our jsp view pages.  So for
> example:
>
>        <s:label key="personBean.firstName" />
>
> would render in the jsp page as:
>
> <tr>
>    <td class="tdLabel"><label for="personBean_firstName" class="label">Your
> first name:</label></td>
>    <td
>><label id="personBean_firstName">Bruce</label></td>
> </tr>
>
> The global-message.properties file has:
>
>    personBean.firstName=Your first name
>
> and the personBean object exists on the value stack and it has a public
> getFirstName() method.
>
> After changing to Struts 2.1.6, using the label tag with the key attribute
> no longer works as it did when we used Struts 2.0.11.  Now the jsp renders:
>
> <tr>
>    <td class="tdLabel"><label for="personBean_firstName" class="label">Your
> first name:</label></td>
>    <td><label id="personBean_firstName">Your first name</label></td>
> </tr>
>
> Instead of showing the value of the personBean.firstName, it shows the value
> from the global-message.properties file (Your First Name)
>
> If I use <s:property value="personBean.firstName" /> the
> personBean.firstName value (Bruce) does display correctly on the jsp page.
>
> We can change our use of the label tag with key attribute to the property
> tag, but we are wondering if this is a documented change in how the label
> tag with key attribute works in 2.1.6 vs 2.0.11 or if this is a bug in
> 2.1.6.
>
> Thanks for the assistance.
>
> Bruce Phillips
> University of Kansas
>
>
>
> --
> View this message in context: http://www.nabble.com/Struts-2.6.1-key-attribute-not-working-as-it-did-in-Struts-2.0.11-tp22413435p22413435.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
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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