You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bruno Cavestro <br...@actoll.com> on 2008/06/16 17:49:52 UTC

differences btw and

Hy
Given the two pieces of codes can you explain me how can i get same output?
A:
   <s:iterator value="myList">
        <s:property /><br>
      </s:iterator>
This produces correctly the following
John<br>
Steve<br>

B:
 <s:iterator value="myList" >
        <s:property value="#this"/><br>
      </s:iterator>
And this produces
[John, alfa.test@13eaab,
com.opensymphony.xwork2.DefaultTextProvider@1d1695e]]<br>
[Steve, alfa.test@13eaab,
com.opensymphony.xwork2.DefaultTextProvider@1d1695e]]<br>


given that myList is an arraylist containing Strings....


Thanx


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


Re: differences btw and

Posted by Musachy Barroso <mu...@gmail.com>.
Ah yes, the projection thing, but is it still defined outside a projection?

musachy

On Tue, Jun 17, 2008 at 7:45 AM, Dave Newton <ne...@yahoo.com> wrote:
> --- On Mon, 6/16/08, Musachy Barroso <mu...@gmail.com> wrote:
>> is there a "#this"? "top" does map to the object on top of the stack.
>
> http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/projection.html
>
> I extrapolated the idea of "the current object" to extend to <s:iterator...> but I didn't check the S2 and/or OGNL code to see who's setting it.
>
> Dave
>
>
> ---------------------------------------------------------------------
> 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: differences btw and

Posted by Dave Newton <ne...@yahoo.com>.
--- On Mon, 6/16/08, Musachy Barroso <mu...@gmail.com> wrote:
> is there a "#this"? "top" does map to the object on top of the stack.

http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/projection.html

I extrapolated the idea of "the current object" to extend to <s:iterator...> but I didn't check the S2 and/or OGNL code to see who's setting it.

Dave


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


Re: differences btw and

Posted by Musachy Barroso <mu...@gmail.com>.
is there a "#this"? "top" does map to the object on top of the stack.

musachy

On Mon, Jun 16, 2008 at 4:54 PM, Dave Newton <ne...@yahoo.com> wrote:
> Because "#this" is mapped to the top of the stack? (It's marginally more complicated than that; "#this" means "the current object", which depends on context. It pops up in projections as well.)
>
> Could be wrong, though.
>
> Dave
>
>
> --- On Mon, 6/16/08, Bruno Cavestro <br...@actoll.com> wrote:
>
>> From: Bruno Cavestro <br...@actoll.com>
>> Subject: differences btw <s:property\> and <s:property value="#this"/>
>> To: "Struts Users Mailing List" <us...@struts.apache.org>
>> Date: Monday, June 16, 2008, 11:49 AM
>> Hy
>> Given the two pieces of codes can you explain me how can i
>> get same output?
>> A:
>>    <s:iterator value="myList">
>>         <s:property /><br>
>>       </s:iterator>
>> This produces correctly the following
>> John<br>
>> Steve<br>
>>
>> B:
>>  <s:iterator value="myList" >
>>         <s:property
>> value="#this"/><br>
>>       </s:iterator>
>> And this produces
>> [John, alfa.test@13eaab,
>> com.opensymphony.xwork2.DefaultTextProvider@1d1695e]]<br>
>> [Steve, alfa.test@13eaab,
>> com.opensymphony.xwork2.DefaultTextProvider@1d1695e]]<br>
>>
>>
>> given that myList is an arraylist containing Strings....
>>
>>
>> Thanx
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> 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: differences btw and

Posted by Dave Newton <ne...@yahoo.com>.
Because "#this" is mapped to the top of the stack? (It's marginally more complicated than that; "#this" means "the current object", which depends on context. It pops up in projections as well.)

Could be wrong, though.

Dave


--- On Mon, 6/16/08, Bruno Cavestro <br...@actoll.com> wrote:

> From: Bruno Cavestro <br...@actoll.com>
> Subject: differences btw <s:property\> and <s:property value="#this"/>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Date: Monday, June 16, 2008, 11:49 AM
> Hy
> Given the two pieces of codes can you explain me how can i
> get same output?
> A:
>    <s:iterator value="myList">
>         <s:property /><br>
>       </s:iterator>
> This produces correctly the following
> John<br>
> Steve<br>
> 
> B:
>  <s:iterator value="myList" >
>         <s:property
> value="#this"/><br>
>       </s:iterator>
> And this produces
> [John, alfa.test@13eaab,
> com.opensymphony.xwork2.DefaultTextProvider@1d1695e]]<br>
> [Steve, alfa.test@13eaab,
> com.opensymphony.xwork2.DefaultTextProvider@1d1695e]]<br>
> 
> 
> given that myList is an arraylist containing Strings....
> 
> 
> Thanx
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org

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