You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Markus Demetz <ma...@demetz.eu> on 2012/03/20 13:49:22 UTC

nested property tag in action tag

hi all,

when I use the <s:action ...> tag inside a jsp with 
executeResult="true", so I can access the properties of that action with 
the <s:property ...> tag inside the result.

but is there a way to to access the same property without forwarding to 
a result, say doing it inline like this:

// jsp code
<s:action name="myAction" executeResult="false">
<s:property value="somePropertyOfMyAction"/>
</s:action>

I assume that when executeResult="false" the action is not put onto the 
stack...
I know I can put it manually onto the value stack like the docs say, but 
this currently confuses me... is there a better way or maybe one has a 
clear explanation?

thanks,
markus





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


Re: nested property tag in action tag

Posted by Markus Demetz <ma...@demetz.eu>.
ok, for now I got it working by doing it in this way:
<s:action name="myAction" var="#myAction" />
<s:property value="#myAction.myProperty"/>

the thing is that I use the OpenSessionInView pattern with hibernate, so 
I get lazy exceptions here since the action already executed (now I 
prepared my specific properties in non lazy mode).
I'm doing so, beacause I need the computation of another action (or 
other actions) to show some common things (e.g. an account summary shown 
in the left column for every action in the /account namespace) while 
executing my action without needing to provide a custom view for every 
call of <s:action...>, so I thought I could put it inline.

regards,
markus



Am 21.03.2012 02:17, schrieb vEnkaTa mohAna rAo SriperumbUdUru:
> I think, you need to reconsider your design let us what you want to do? why
> are you doing so?
>
> On Tue, Mar 20, 2012 at 6:19 PM, Markus Demetz<ma...@demetz.eu>  wrote:
>
>> hi all,
>>
>> when I use the<s:action ...>  tag inside a jsp with executeResult="true",
>> so I can access the properties of that action with the<s:property ...>  tag
>> inside the result.
>>
>> but is there a way to to access the same property without forwarding to a
>> result, say doing it inline like this:
>>
>> // jsp code
>> <s:action name="myAction" executeResult="false">
>> <s:property value="somePropertyOfMyAction"**/>
>> </s:action>
>>
>> I assume that when executeResult="false" the action is not put onto the
>> stack...
>> I know I can put it manually onto the value stack like the docs say, but
>> this currently confuses me... is there a better way or maybe one has a
>> clear explanation?
>>
>> thanks,
>> markus
>>
>>
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@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


Re: nested property tag in action tag

Posted by vEnkaTa mohAna rAo SriperumbUdUru <mo...@gmail.com>.
I think, you need to reconsider your design let us what you want to do? why
are you doing so?

On Tue, Mar 20, 2012 at 6:19 PM, Markus Demetz <ma...@demetz.eu> wrote:

> hi all,
>
> when I use the <s:action ...> tag inside a jsp with executeResult="true",
> so I can access the properties of that action with the <s:property ...> tag
> inside the result.
>
> but is there a way to to access the same property without forwarding to a
> result, say doing it inline like this:
>
> // jsp code
> <s:action name="myAction" executeResult="false">
> <s:property value="somePropertyOfMyAction"**/>
> </s:action>
>
> I assume that when executeResult="false" the action is not put onto the
> stack...
> I know I can put it manually onto the value stack like the docs say, but
> this currently confuses me... is there a better way or maybe one has a
> clear explanation?
>
> thanks,
> markus
>
>
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>
>