This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • push
Skip to end of metadata
Go to start of metadata

Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.

Description

Push value on stack for simplified usage.

Parameters

Dynamic Attributes Allowed:

false
 

Name

Required

Default

Evaluated

Type

Description

value true false String Value to push on stack

Examples

Error rendering macro 'code': Invalid value specified for parameter 'java.lang.NullPointerException'
<s:push value="user">
    <s:propery value="firstName" />
    <s:propery value="lastName" />
</s:push>
Error rendering macro 'code': Invalid value specified for parameter 'java.lang.NullPointerException'
Pushed user into the stack, and hence property tag could access user's properties
(firstName, lastName etc) since user is now at the top of the stack
Error rendering macro 'code': Invalid value specified for parameter 'java.lang.NullPointerException'
<s:push value="myObject">                              ----- (1)
     <s:bean name="jp.SomeBean" var="myBean"/>        ----- (2)
        <s:param name="myParam" value="top"/>        ----- (3)
     </s:bean>
 </s:push>
Error rendering macro 'code': Invalid value specified for parameter 'java.lang.NullPointerException'
when in (1), myObject is at the top of the stack
when in (2), jp.SomeBean is in the top of stack, also in stack's context with key myBean
when in (3), top will get the jp.SomeBean instance
Error rendering macro 'code': Invalid value specified for parameter 'java.lang.NullPointerException'
<s:push value="myObject">                                       ---(A)
   <s:bean name="jp.SomeBean" var="myBean"/>                   ---(B)
      <s:param name="myParam" value="top.mySomeOtherValue"/>  ---(C)
   </s:bean>
</s:push>
Error rendering macro 'code': Invalid value specified for parameter 'java.lang.NullPointerException'
when in (A), myObject is at the top of the stack
when in (B), jp.SomeBean is at the top of the stack, also in context with key myBean
when in (C), top refers to jp.SomeBean instance. so top.mySomeOtherValue would invoke SomeBean's mySomeOtherValue() method
Error rendering macro 'code': Invalid value specified for parameter 'java.lang.NullPointerException'
<s:push value="myObject">                                 ---- (i)
   <s:bean name="jp.SomeBean" var="myBean"/>             ---- (ii)
      <s:param name="myParam" value="[1].top"/>         -----(iii)
   </s:bean>
</s:push>
Error rendering macro 'code': Invalid value specified for parameter 'java.lang.NullPointerException'
when in (i), myObject is at the top of the stack
when in (ii), jp.SomeBean is at the top of the stack, followed by myObject
when in (iii), [1].top will returned top of the cut of stack starting from myObject, namely myObject itself
  • No labels

1 Comment

  1. Change

    <s:propery value="firstName" />
    <s:propery value="lastName" />

    to

    <s:property value="firstName" />
    <s:property value="lastName" />