struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken McWilliams <ken.mcwilli...@gmail.com>
Subject Re: Not setting instance member value in destination action using action chaining?
Date Sat, 02 Mar 2013 09:31:29 GMT
This was already addressed on SO:
http://stackoverflow.com/questions/15159827/not-setting-instance-member-value-in-destination-action-using-action-chaining
We explained that chain was a result and that the chaining interceptor did
not process additional parameters and so they would not be included, if you
want empMode to be true then have it as a property of the action and set
it's value to true before chaining and the comments also covered it is
generally best to avoid chain if possible.

What is unclear?


On Sat, Mar 2, 2013 at 1:45 AM, Mohit Gupta <motgupta@gmail.com> wrote:

> This is my struts 2 flow where i am using action chaining
>
> JSP--->Action1--->Action2--->ResultJsp
>
> With action chaining , my understanding is that request is forwarded from
> action1 to action2.So if i pass some parameter from action1 to action 2
> it should be set in new action instance variable(/value stack created for
> new action).But its not happening
>
> Below is my code in action1
>
>
>     @Result(name = "displayEmployee",type = "chain",
>             params = {
>                 "namespace", "/employee",
>                 "actionName", "Employee-lookup!search",
>                 "empMode", "true"
>
>             })
>
>
>     @Action("display-employee!displayEmployee")
>       public String displayEmployee() {
>         return "displayEmployee";
>       }
>
> Now in Action 2 i.e display-employee , i have boolean property with name
> empMode. But i get the value as false though i should get it true
> because i am passing it as attribute in result annotation. As my
> understanding in action chaining, all request paramaters are
> forwarded from action1 to action2. Basically new value stack is created for
> action2 which contains the variables which were present
> in action1. So why value true is not set for empMode property in action 2?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message