The pushed object will be on the stack while the tag is evaluated (in
the tag body), and it will be popped after the end of the tag, so
<s:push value="%{'not now john'}">
<s:property value="%{top}"/> <--- will print 'not now john'
<s:push>
<s:property value="%{top}"/> <--will print whatever was in the top of
the stack, before the "push" tag was invoked
Thank you Musachy.
If I am right, the example in the tutorial does not work.
Working codes:
================
<s:push value="artist">
Artist Name:<s:property value="name" /> <BR/>
Artist Bio: <s:property value="bio" /> <BR/>
</s:push>
*Not* working codes shown in the link:
>>http://www.vaannila.com/struts-2/struts-2-example/struts-2-push-tag-example1.html
====================================================
<s:push value="artist" />
Artist Name:<s:property value="name" /> <BR/>
Artist Bio: <s:property value="bio" /> <BR/>
Push an object, and then retrieve the object's attribute outside s:push
tag will not work (have to use artist.name).
--
Lu Ying
Struts2.1.8.1, the following push example
http://www.vaannila.com/struts-2/struts-2-example/struts-2-push-tag-example1.html
Title returns, but "s:push" never returns attributes such as "name" under
artist. Does someone tries and knows the reason?
<b>Album Title: </b> <s:property value="title" /> <BR/>
<s:push value="artist" />
<B>Artist Name: </B> <s:property value="name" /> <BR/>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org