You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wolfgang Knauf <hi...@freenet.de> on 2009/02/05 22:45:11 UTC

Re: [S2] s:action in value stack?

Hmmm, no reply. So I will bounce this issue one last time...

Up to now, nobody could tell me why an action called by "<s:action>" is 
not placed on the value stack the same way as an action called by URL.

Wolfgang

Wolfgang Knauf wrote:
> 
> Musachy Barroso wrote:
>> what does <s:property value="top" /> prints in the action result?
>>
> 
> I updated my sample 
> (http://www.informatik.fh-wiesbaden.de/~knauf/private/struts2/Struts2Action.war) 
> so that the JSP outputs this:
> 
> <s:action name="someaction" var="someActionVariable">
> Inside s:action: Property "id": <s:property value="id"/> <br/>
> Inside s:action: Property #someActionVariable.id: <s:property 
> value="#someActionVariable.id"/><br/>
> Inside s:action: Property "top.id": <s:property value="top.id"/> <br/>
> Inside s:action: Property "top": <s:property value="top"/> <br/>
> </s:action>
> 
> Property "id": <s:property value="id"/> <br/>
> Property #someActionVariable.id: <s:property 
> value="#someActionVariable.id"/><br/>
> Property "top.id": <s:property value="top.id"/> <br/>
> Property "top": <s:property value="top"/> <br/>
> 
> ======================
> Calling the JSP (http://localhost:8080/Struts2Action/index.jsp) results 
> in this HTML output:
> 
> Inside s:action: Property "id":
> Inside s:action: Property #someActionVariable.id:
> Inside s:action: Property "top.id":
> Inside s:action: Property "top": 
> com.opensymphony.xwork2.DefaultTextProvider@1e6bfea
> Property "id":
> Property #someActionVariable.id: 10
> Property "top.id":
> Property "top": com.opensymphony.xwork2.DefaultTextProvider@1e6bfea
> 
> 
> ======================
> First calling the Action 
> (http://localhost:8080/Struts2Action/someaction.action) results in this 
> HTML output:
> 
> Inside s:action: Property "id": 10
> Inside s:action: Property #someActionVariable.id:
> Inside s:action: Property "top.id": 10
> Inside s:action: Property "top": de.knauf.actions.SomeAction@e2e59e
> Property "id": 10
> Property #someActionVariable.id: 10
> Property "top.id": 10
> Property "top": de.knauf.actions.SomeAction@e2e59e
> 
> ===========================
> What is this "com.opensymphony.xwork2.DefaultTextProvider" on top of the 
> value stack?
> 
> And it seems the <s:action> action is NEVER put on the actions value 
> stack?! Maybe this is the intended behaviour, but if yes the doc needs 
> an update ;-).
> But I would expect to find an <s:action> action on top of the value 
> stack for the rest of the page.
> 
> Thanks
> 
> Wolfgang


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


Re: [S2] s:action in value stack?

Posted by Wolfgang Knauf <hi...@freenet.de>.
Hi Musachy,

what you say makes sense, but then I think one thing is missing in the 
doc for s:action (http://struts.apache.org/2.1.6/docs/action.html):

I suggest something like this:
"The action is never placed on the value stack like an action called by 
URL, so that accessing fields of it with a syntax "<s:property 
value="actionfield"/> is NOT possible. Declare a variable instead".

This would avoid my misunderstanding.

Thanks

Wolfgang


Musachy Barroso wrote:
> Didn't my previous email answer your questions?
> 
> "Ok, let me try to clarify this, if the result of some action, lets
> call it "firstAction" contains:
> 
> <s:action var="secondAction" ...>
>   <!-- tag content -->
> <s:/action>
> 
> while the result of "secondAction" is executed, "secondAction" will be
> on top of the stack, and it is not available by name in the stack.
> Inside the tag content, "firstAction" is on top of the stack. Outside
> the action tag, "firstAction" is on top of the stack, and
> "secondAction" can be referenced by name.
> 
> "
> That says what is on the stack at every moment.
> 
> musachy
> 


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


Re: [S2] s:action in value stack?

Posted by Musachy Barroso <mu...@gmail.com>.
Didn't my previous email answer your questions?

"Ok, let me try to clarify this, if the result of some action, lets
call it "firstAction" contains:

<s:action var="secondAction" ...>
  <!-- tag content -->
<s:/action>

while the result of "secondAction" is executed, "secondAction" will be
on top of the stack, and it is not available by name in the stack.
Inside the tag content, "firstAction" is on top of the stack. Outside
the action tag, "firstAction" is on top of the stack, and
"secondAction" can be referenced by name.

"
That says what is on the stack at every moment.

musachy

On Thu, Feb 5, 2009 at 4:45 PM, Wolfgang Knauf <hi...@freenet.de> wrote:
> Hmmm, no reply. So I will bounce this issue one last time...
>
> Up to now, nobody could tell me why an action called by "<s:action>" is not
> placed on the value stack the same way as an action called by URL.
>
> Wolfgang
>
> Wolfgang Knauf wrote:
>>
>> Musachy Barroso wrote:
>>>
>>> what does <s:property value="top" /> prints in the action result?
>>>
>>
>> I updated my sample
>> (http://www.informatik.fh-wiesbaden.de/~knauf/private/struts2/Struts2Action.war)
>> so that the JSP outputs this:
>>
>> <s:action name="someaction" var="someActionVariable">
>> Inside s:action: Property "id": <s:property value="id"/> <br/>
>> Inside s:action: Property #someActionVariable.id: <s:property
>> value="#someActionVariable.id"/><br/>
>> Inside s:action: Property "top.id": <s:property value="top.id"/> <br/>
>> Inside s:action: Property "top": <s:property value="top"/> <br/>
>> </s:action>
>>
>> Property "id": <s:property value="id"/> <br/>
>> Property #someActionVariable.id: <s:property
>> value="#someActionVariable.id"/><br/>
>> Property "top.id": <s:property value="top.id"/> <br/>
>> Property "top": <s:property value="top"/> <br/>
>>
>> ======================
>> Calling the JSP (http://localhost:8080/Struts2Action/index.jsp) results in
>> this HTML output:
>>
>> Inside s:action: Property "id":
>> Inside s:action: Property #someActionVariable.id:
>> Inside s:action: Property "top.id":
>> Inside s:action: Property "top":
>> com.opensymphony.xwork2.DefaultTextProvider@1e6bfea
>> Property "id":
>> Property #someActionVariable.id: 10
>> Property "top.id":
>> Property "top": com.opensymphony.xwork2.DefaultTextProvider@1e6bfea
>>
>>
>> ======================
>> First calling the Action
>> (http://localhost:8080/Struts2Action/someaction.action) results in this HTML
>> output:
>>
>> Inside s:action: Property "id": 10
>> Inside s:action: Property #someActionVariable.id:
>> Inside s:action: Property "top.id": 10
>> Inside s:action: Property "top": de.knauf.actions.SomeAction@e2e59e
>> Property "id": 10
>> Property #someActionVariable.id: 10
>> Property "top.id": 10
>> Property "top": de.knauf.actions.SomeAction@e2e59e
>>
>> ===========================
>> What is this "com.opensymphony.xwork2.DefaultTextProvider" on top of the
>> value stack?
>>
>> And it seems the <s:action> action is NEVER put on the actions value
>> stack?! Maybe this is the intended behaviour, but if yes the doc needs an
>> update ;-).
>> But I would expect to find an <s:action> action on top of the value stack
>> for the rest of the page.
>>
>> Thanks
>>
>> Wolfgang
>
>
> ---------------------------------------------------------------------
> 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