Re: Action chaining not forwarding ModelDriven model properties

2018-03-03 Thread Yasser Zamani


On 2/28/2018 3:47 PM, shahzad.ismail@ wrote:
> I've debugged it a bit and able to figure out that, initially, at the start 
> of action1, request.getParamater("modelprop") is null then I set modelprop in 
> the action1 method which makes mymodel.modelprop == "something" and 
> request.getAttribute("modelprop") == "something" but the 
> request.getParameter("modelprop") remains null by the end of action1 method. 
> So when it chains to action2 method, it simply rewrites 
> request.getParameter("modelprop") value, which is *null*, back to both, 
> request.getAttribute("modelprop") and mymodel.modelprop. Am I messing up with 
> some interceptor configuration?
> I've tried it with type="redirectAction" and the problem of not passing 
> mymodel.modelprop from action1 to action2 remains.
> Any suggestions would be appreciated.

AFAIR the chain result doesn't set destination action props from
request, but in your case, it calls action1.getModel() and gets the
object then calls action2.setModel(the object).

Could you try these and see what happens:

1. Via your browser, browse action2 directly (instead of action1).
2. Try different configs like action2->action3->action1, or
action3->action1->action2, or action2->action1->action3, or
action3->action2->action1.

Regards.



Re: Action chaining not forwarding ModelDriven model properties

2018-03-01 Thread Lukasz Lenart
Can you share a source code of your actions?

2018-02-28 13:17 GMT+01:00 shahzad.ism...@gmail.com :
> Hi,
> I'm migrating an app from Struts 1 to Struts 2 (Tomcat v8 and Struts 
> 2.5.14.1). There is a scenario in which mapping goes like:
> jsp1 --> action1 --> action2 --> action3 --> jsp2
>
> So it must be type="chain" for action1 --> action2 and action2 --> action3 as 
> I need to pass ModelDriven model as well as some action member variables, 
> some of them are non-strings. All 3 actions are chaining to different methods 
> of the same action class.
> The **problem** is that action1 --> action2 is passing action variables but 
> not passing any properties of model even though action2 --> action3 is 
> passing all the action variables as well as model properties.
> I'm only using defaultStack of interceptor.
> My interceptors are defined as:
>
> 
> 
> 
> 
>  name="exception.logEnabled">true
> DEBUG
>  name="params.excludeParams">dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*
> 
> 
> 
> 
>
>
> And I'm using them as:
>
> 
>  
> *
> insert
> *
> insert
> 
> kmList_actionmethod2
> kmList_actionmethod3
> 
> actionmethod1, actionmethod2, actionmethod3
> 
> 
>
> I've debugged it a bit and able to figure out that, initially, at the start 
> of action1, request.getParamater("modelprop") is null then I set modelprop in 
> the action1 method which makes mymodel.modelprop == "something" and 
> request.getAttribute("modelprop") == "something" but the 
> request.getParameter("modelprop") remains null by the end of action1 method. 
> So when it chains to action2 method, it simply rewrites 
> request.getParameter("modelprop") value, which is *null*, back to both, 
> request.getAttribute("modelprop") and mymodel.modelprop. Am I messing up with 
> some interceptor configuration?
> I've tried it with type="redirectAction" and the problem of not passing 
> mymodel.modelprop from action1 to action2 remains.
> Any suggestions would be appreciated.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>

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



Action chaining not forwarding ModelDriven model properties

2018-02-28 Thread shahzad . ismail
Hi,
I'm migrating an app from Struts 1 to Struts 2 (Tomcat v8 and Struts 2.5.14.1). 
There is a scenario in which mapping goes like:
jsp1 --> action1 --> action2 --> action3 --> jsp2

So it must be type="chain" for action1 --> action2 and action2 --> action3 as I 
need to pass ModelDriven model as well as some action member variables, some of 
them are non-strings. All 3 actions are chaining to different methods of the 
same action class.  
The **problem** is that action1 --> action2 is passing action variables but not 
passing any properties of model even though action2 --> action3 is passing all 
the action variables as well as model properties.  
I'm only using defaultStack of interceptor.  
My interceptors are defined as:  





true
DEBUG
dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*






And I'm using them as:  


 
*
insert
*
insert

kmList_actionmethod2
kmList_actionmethod3

actionmethod1, actionmethod2, actionmethod3



I've debugged it a bit and able to figure out that, initially, at the start of 
action1, request.getParamater("modelprop") is null then I set modelprop in the 
action1 method which makes mymodel.modelprop == "something" and 
request.getAttribute("modelprop") == "something" but the 
request.getParameter("modelprop") remains null by the end of action1 method. So 
when it chains to action2 method, it simply rewrites 
request.getParameter("modelprop") value, which is *null*, back to both, 
request.getAttribute("modelprop") and mymodel.modelprop. Am I messing up with 
some interceptor configuration?
I've tried it with type="redirectAction" and the problem of not passing 
mymodel.modelprop from action1 to action2 remains.
Any suggestions would be appreciated.

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



Re: Not setting instance member value in destination action using action chaining?

2013-03-02 Thread Mohit Gupta
My guess is Action chaining is meant for forwarding the request to struts 2
actions only ,not to legacy actions. Right? If yes, How can i forward the
request to non struts 2 action  from struts 2 action using result
annotation.

My understanding of action chaining after looking the source code of
ActionChainResult.java is that new Action context  is created  where value
stack and parameter map created for new action will contain the values from
valueStack/Parameter map for previous action value stack.(Probably request
attributes set in previous action wont be available inside in new action,
is that correct)?

On Sat, Mar 2, 2013 at 3:39 PM, Ken McWilliams wrote:

> Not sure what you mean.
>
>
> On Sat, Mar 2, 2013 at 2:58 AM, Mohit Gupta  wrote:
>
> > Ken one more thing can we use action chaining to forward the request to
> > action which is not struts 2. i know action chaining shoukld be
> discourged
> > but just exploring the options.
> >
> > On Sat, Mar 2, 2013 at 3:01 PM, Ken McWilliams  > >wrote:
> >
> > > 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 
> 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?
> > > >
> > >
> >
>


Re: Not setting instance member value in destination action using action chaining?

2013-03-02 Thread Ken McWilliams
Not sure what you mean.


On Sat, Mar 2, 2013 at 2:58 AM, Mohit Gupta  wrote:

> Ken one more thing can we use action chaining to forward the request to
> action which is not struts 2. i know action chaining shoukld be discourged
> but just exploring the options.
>
> On Sat, Mar 2, 2013 at 3:01 PM, Ken McWilliams  >wrote:
>
> > 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  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?
> > >
> >
>


Re: Not setting instance member value in destination action using action chaining?

2013-03-02 Thread Mohit Gupta
Ken one more thing can we use action chaining to forward the request to
action which is not struts 2. i know action chaining shoukld be discourged
but just exploring the options.

On Sat, Mar 2, 2013 at 3:01 PM, Ken McWilliams wrote:

> 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  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?
> >
>


Re: Not setting instance member value in destination action using action chaining?

2013-03-02 Thread Mohit Gupta
oops i missed  ur's todays answer on so. Thanx. Its clear now

On Sat, Mar 2, 2013 at 3:01 PM, Ken McWilliams wrote:

> 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  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?
> >
>


Re: Not setting instance member value in destination action using action chaining?

2013-03-02 Thread Ken McWilliams
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  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?
>


Not setting instance member value in destination action using action chaining?

2013-03-02 Thread Mohit Gupta
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?


RE: Using action-chaining as alias (URI-rewrite)

2012-08-07 Thread fustaki
Freemarker 2.3.19. (It comes with Struts 2.3.4)



--
View this message in context: 
http://struts.1045723.n5.nabble.com/Using-action-chaining-as-alias-URI-rewrite-tp5710391p5710393.html
Sent from the Struts - User mailing list archive at Nabble.com.

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



RE: Using action-chaining as alias (URI-rewrite)

2012-08-07 Thread Martin Gainty

what version of freemarker are you using?

Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.


> Date: Tue, 7 Aug 2012 04:49:32 -0700
> From: lorenzo.bernacchi...@gmail.com
> To: user@struts.apache.org
> Subject: Using action-chaining as alias (URI-rewrite)
> 
> I'm using chain results to produce a URI alias pattern.
> 
> here is a dummy example of laptop searcher
> 
> 
>   {1}
>   laptops.ftl
> 
> 
> to mantain friendly URLs in a spanish-localized domain we want to use the
> keyword "portatiles" instead of "laptops"
> 
> URI can be routed this way
> 
> 
>   {1}/laptops
> 
> 
> ActionSupport will always return SUCCESS and the param "brand" will move
> from one action-name to the other.
> 
> 
> I found this pattern useful when you need many of these aliases (one for
> language) and you want to keep the routing configuration in a single
> segment. All these aliases will act as a URI-rewrite module.
> 
> 
> Is there a better way to achieve this behavior?
> 
> Note: Between versions 2.2.X and 2.3.X Struts introduced an escapeHTML4
> operation to action-names (DefaultActionProxy class) and this pattern no
> longer works (there is a double escaping I can't unescape..)
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://struts.1045723.n5.nabble.com/Using-action-chaining-as-alias-URI-rewrite-tp5710391.html
> Sent from the Struts - User mailing list archive at Nabble.com.
  

Using action-chaining as alias (URI-rewrite)

2012-08-07 Thread fustaki
I'm using chain results to produce a URI alias pattern.

here is a dummy example of laptop searcher


  {1}
  laptops.ftl


to mantain friendly URLs in a spanish-localized domain we want to use the
keyword "portatiles" instead of "laptops"

URI can be routed this way


  {1}/laptops


ActionSupport will always return SUCCESS and the param "brand" will move
from one action-name to the other.


I found this pattern useful when you need many of these aliases (one for
language) and you want to keep the routing configuration in a single
segment. All these aliases will act as a URI-rewrite module.


Is there a better way to achieve this behavior?

Note: Between versions 2.2.X and 2.3.X Struts introduced an escapeHTML4
operation to action-names (DefaultActionProxy class) and this pattern no
longer works (there is a double escaping I can't unescape..)







--
View this message in context: 
http://struts.1045723.n5.nabble.com/Using-action-chaining-as-alias-URI-rewrite-tp5710391.html
Sent from the Struts - User mailing list archive at Nabble.com.

Re: How to avoid PreResultListener called twice in action chaining

2010-12-24 Thread Chris Pratt
Two ideas, provide your own wrapper around the HttpServletRequest that does
allow getting back the cookies (probably more work that it's worth), or add
the cookies as a request attribute that you can query to see which cookies
were added during this request.  If it comes back null, you're the first (or
only) in the chain, if not, then you have the list of cookies that were
added.  I'm not sure if you'll be able to overwrite an existing cookie, but
you could, institute a "first-come, first-served" rule.
  (*Chris*)

On Fri, Dec 24, 2010 at 10:22 AM,  wrote:

> How can I do that when I chain actions?. I mean, the second action is
> chained after the first one, but there are situations in which there is no
> chaining at all(both actions can be executed indepently) or the chaining can
> be the other way. In all cases I need to keep only the last cookie
> generated. I can keep a set of cookies in the request, but how I can put
> them into the request after all the processing has been done? Since if I
> chain the actions, there is no way to know programatically which is the last
> one, right? Or is there?
>
> Thanks
> Jose
> Sent via BlackBerry from T-Mobile
>
> -Original Message-
> From: Dave Newton 
> Date: Fri, 24 Dec 2010 12:57:53
> To: Struts Users Mailing List; 
> Subject: Re: How to avoid PreResultListener called twice in action chaining
>
> Save cookies outside the request then, and only add the cookie at the last
> minute.
>
> Dave
> On Dec 24, 2010 8:49 AM,  wrote:
> > Can't be done. The HttpServletResponse does not provide a method to check
> if there is already a cookie on the request. And I need to put the cookie
> generated by the last action, not the first one.
> > Sent via BlackBerry from T-Mobile
> >
> > -Original Message-
> > From: Dave Newton 
> > Date: Fri, 24 Dec 2010 07:47:59
> > To: Struts Users Mailing List
> > Reply-To: "Struts Users Mailing List" 
> > Subject: Re: How to avoid PreResultListener called twice in action
> chaining
> >
> > Check to see if it's already there?
> >
> > On Fri, Dec 24, 2010 at 7:04 AM, JOSE L MARTINEZ-AVIAL  >wrote:
> >
> >> Hello all,
> >> I've developed an interceptor to add cookies to the response. It works
> as
> >> follows:
> >> [..]
> >> public String intercept(ActionInvocation invocation) throws Exception {
> >> invocation.addPreResultListener(this);
> >> return invocation.invoke();
> >> }
> >>
> >> public void beforeResult(ActionInvocation invocation, String resultCode)
> {
> >> //log.debug("beforeResult start");
> >> ActionContext ac = invocation.getInvocationContext();
> >> HttpServletResponse response = (HttpServletResponse)
> >> ac.get(StrutsStatics.HTTP_RESPONSE);
> >> addCookiesToResponse(invocation.getAction(), response);
> >> //log.debug("beforeResult end");
> >> }
> >> private void addCookiesToResponse(Object action, HttpServletResponse
> >> response) {
> >> //log.info("CookieProviderInterceptor "+action);
> >> if (action instanceof CookieProvider) {
> >>
> >>
> >> Map cookies = ((CookieProvider)
> >> action).getCookies();
> >> //log.info("CookieProviderInterceptor "+cookies);
> >>
> >> if (cookies != null) {
> >> Set> cookieSet =
> >> cookies.entrySet();
> >> for (Entry entry : cookieSet) {
> >> CookieBean cookiebean = entry.getValue();
> >> Cookie cookie = new Cookie(cookiebean.getCookieName(),
> >> cookiebean.getCookieValue());
> >> cookie.setMaxAge(cookiebean.getMaxAge());
> >> cookie.setComment(cookiebean.getComment());
> >> if (cookiebean.getDomain()!=null)
> >> cookie.setDomain(cookiebean.getDomain());
> >> cookie.setPath(cookiebean.getPath());
> >> cookie.setSecure(cookiebean.getSecure());
> >> cookie.setVersion(cookiebean.getVersion());
> >> //log.info("adding "+cookie);
> >> response.addCookie(cookie);
> >> }
> >> }
> >> }
> >> }
> >>
> >> So the idea is that the Action implements CookieProvider, returning a
> map
> >> of
> >> cookies, and put the cookies in the response. It works well, but I'm
> having
> >> some problems when I chain two actions, if both of them are
> CookieProvider,
> >> and both return a cookie with the same name. My idea was be that the
> first
> >> cookie would be overwritten by the second one, but in fact the response
> has
> >> both cookies, with the same name. After giving it a thought, it makes
> >> sense,
> >> so probably I'm doing something wrong. Any insight on how to do this?
> >>
> >> TIA
> >>
> >> Jose Luis
> >>
> >
>
>


Re: How to avoid PreResultListener called twice in action chaining

2010-12-24 Thread Dave Newton
Yet another reason to avoid action chaining, too.
On Dec 24, 2010 2:29 PM, "Maurizio Cucchiara" 
wrote:
> There should be at least a way to check if request live along a chain
> request, it could be possible by asking for size at stack.getRoot()
>
> Maurizio Cucchiara
>
> On Dec 24, 2010 7:22 PM,  wrote:
> How can I do that when I chain actions?. I mean, the second action is
> chained after the first one, but there are situations in which there is no
> chaining at all(both actions can be executed indepently) or the chaining
can
> be the other way. In all cases I need to keep only the last cookie
> generated. I can keep a set of cookies in the request, but how I can put
> them into the request after all the processing has been done? Since if I
> chain the actions, there is no way to know programatically which is the
last
> one, right? Or is there?
>
> Thanks
> Jose
>
> Sent via BlackBerry from T-Mobile
>
> -Original Message-
> From: Dave Newton 
> Date: Fri, 24 Dec 2010 12:57:53
> To: Struts Users Mailing List; 

Re: How to avoid PreResultListener called twice in action chaining

2010-12-24 Thread Maurizio Cucchiara
There should be at least a way to check if request live along a chain
request, it could be possible by asking for size at stack.getRoot()

Maurizio Cucchiara

On Dec 24, 2010 7:22 PM,  wrote:
How can I do that when I chain actions?. I mean, the second action is
chained after the first one, but there are situations in which there is no
chaining at all(both actions can be executed indepently) or the chaining can
be the other way. In all cases I need to keep only the last cookie
generated. I can keep a set of cookies in the request, but how I can put
them into the request after all the processing has been done? Since if I
chain the actions, there is no way to know programatically which is the last
one, right? Or is there?

Thanks
Jose

Sent via BlackBerry from T-Mobile

-Original Message-
From: Dave Newton ; 

Re: How to avoid PreResultListener called twice in action chaining

2010-12-24 Thread jlmagc
How can I do that when I chain actions?. I mean, the second action is chained 
after the first one, but there are situations in which there is no chaining at 
all(both actions can be executed indepently) or the chaining can be the other 
way. In all cases I need to keep only the last cookie generated. I can keep a 
set of cookies in the request, but how I can put them into the request after 
all the processing has been done? Since if I chain the actions, there is no way 
to know programatically which is the last one, right? Or is there?

Thanks
Jose
Sent via BlackBerry from T-Mobile

-Original Message-
From: Dave Newton 
Date: Fri, 24 Dec 2010 12:57:53 
To: Struts Users Mailing List; 
Subject: Re: How to avoid PreResultListener called twice in action chaining

Save cookies outside the request then, and only add the cookie at the last
minute.

Dave
On Dec 24, 2010 8:49 AM,  wrote:
> Can't be done. The HttpServletResponse does not provide a method to check
if there is already a cookie on the request. And I need to put the cookie
generated by the last action, not the first one.
> Sent via BlackBerry from T-Mobile
>
> -Original Message-
> From: Dave Newton 
> Date: Fri, 24 Dec 2010 07:47:59
> To: Struts Users Mailing List
> Reply-To: "Struts Users Mailing List" 
> Subject: Re: How to avoid PreResultListener called twice in action
chaining
>
> Check to see if it's already there?
>
> On Fri, Dec 24, 2010 at 7:04 AM, JOSE L MARTINEZ-AVIAL wrote:
>
>> Hello all,
>> I've developed an interceptor to add cookies to the response. It works as
>> follows:
>> [..]
>> public String intercept(ActionInvocation invocation) throws Exception {
>> invocation.addPreResultListener(this);
>> return invocation.invoke();
>> }
>>
>> public void beforeResult(ActionInvocation invocation, String resultCode)
{
>> //log.debug("beforeResult start");
>> ActionContext ac = invocation.getInvocationContext();
>> HttpServletResponse response = (HttpServletResponse)
>> ac.get(StrutsStatics.HTTP_RESPONSE);
>> addCookiesToResponse(invocation.getAction(), response);
>> //log.debug("beforeResult end");
>> }
>> private void addCookiesToResponse(Object action, HttpServletResponse
>> response) {
>> //log.info("CookieProviderInterceptor "+action);
>> if (action instanceof CookieProvider) {
>>
>>
>> Map cookies = ((CookieProvider)
>> action).getCookies();
>> //log.info("CookieProviderInterceptor "+cookies);
>>
>> if (cookies != null) {
>> Set> cookieSet =
>> cookies.entrySet();
>> for (Entry entry : cookieSet) {
>> CookieBean cookiebean = entry.getValue();
>> Cookie cookie = new Cookie(cookiebean.getCookieName(),
>> cookiebean.getCookieValue());
>> cookie.setMaxAge(cookiebean.getMaxAge());
>> cookie.setComment(cookiebean.getComment());
>> if (cookiebean.getDomain()!=null)
>> cookie.setDomain(cookiebean.getDomain());
>> cookie.setPath(cookiebean.getPath());
>> cookie.setSecure(cookiebean.getSecure());
>> cookie.setVersion(cookiebean.getVersion());
>> //log.info("adding "+cookie);
>> response.addCookie(cookie);
>> }
>> }
>> }
>> }
>>
>> So the idea is that the Action implements CookieProvider, returning a map
>> of
>> cookies, and put the cookies in the response. It works well, but I'm
having
>> some problems when I chain two actions, if both of them are
CookieProvider,
>> and both return a cookie with the same name. My idea was be that the
first
>> cookie would be overwritten by the second one, but in fact the response
has
>> both cookies, with the same name. After giving it a thought, it makes
>> sense,
>> so probably I'm doing something wrong. Any insight on how to do this?
>>
>> TIA
>>
>> Jose Luis
>>
>



Re: How to avoid PreResultListener called twice in action chaining

2010-12-24 Thread Dave Newton
Save cookies outside the request then, and only add the cookie at the last
minute.

Dave
On Dec 24, 2010 8:49 AM,  wrote:
> Can't be done. The HttpServletResponse does not provide a method to check
if there is already a cookie on the request. And I need to put the cookie
generated by the last action, not the first one.
> Sent via BlackBerry from T-Mobile
>
> -Original Message-
> From: Dave Newton 
> Date: Fri, 24 Dec 2010 07:47:59
> To: Struts Users Mailing List
> Reply-To: "Struts Users Mailing List" 
> Subject: Re: How to avoid PreResultListener called twice in action
chaining
>
> Check to see if it's already there?
>
> On Fri, Dec 24, 2010 at 7:04 AM, JOSE L MARTINEZ-AVIAL wrote:
>
>> Hello all,
>> I've developed an interceptor to add cookies to the response. It works as
>> follows:
>> [..]
>> public String intercept(ActionInvocation invocation) throws Exception {
>> invocation.addPreResultListener(this);
>> return invocation.invoke();
>> }
>>
>> public void beforeResult(ActionInvocation invocation, String resultCode)
{
>> //log.debug("beforeResult start");
>> ActionContext ac = invocation.getInvocationContext();
>> HttpServletResponse response = (HttpServletResponse)
>> ac.get(StrutsStatics.HTTP_RESPONSE);
>> addCookiesToResponse(invocation.getAction(), response);
>> //log.debug("beforeResult end");
>> }
>> private void addCookiesToResponse(Object action, HttpServletResponse
>> response) {
>> //log.info("CookieProviderInterceptor "+action);
>> if (action instanceof CookieProvider) {
>>
>>
>> Map cookies = ((CookieProvider)
>> action).getCookies();
>> //log.info("CookieProviderInterceptor "+cookies);
>>
>> if (cookies != null) {
>> Set> cookieSet =
>> cookies.entrySet();
>> for (Entry entry : cookieSet) {
>> CookieBean cookiebean = entry.getValue();
>> Cookie cookie = new Cookie(cookiebean.getCookieName(),
>> cookiebean.getCookieValue());
>> cookie.setMaxAge(cookiebean.getMaxAge());
>> cookie.setComment(cookiebean.getComment());
>> if (cookiebean.getDomain()!=null)
>> cookie.setDomain(cookiebean.getDomain());
>> cookie.setPath(cookiebean.getPath());
>> cookie.setSecure(cookiebean.getSecure());
>> cookie.setVersion(cookiebean.getVersion());
>> //log.info("adding "+cookie);
>> response.addCookie(cookie);
>> }
>> }
>> }
>> }
>>
>> So the idea is that the Action implements CookieProvider, returning a map
>> of
>> cookies, and put the cookies in the response. It works well, but I'm
having
>> some problems when I chain two actions, if both of them are
CookieProvider,
>> and both return a cookie with the same name. My idea was be that the
first
>> cookie would be overwritten by the second one, but in fact the response
has
>> both cookies, with the same name. After giving it a thought, it makes
>> sense,
>> so probably I'm doing something wrong. Any insight on how to do this?
>>
>> TIA
>>
>> Jose Luis
>>
>


Re: How to avoid PreResultListener called twice in action chaining

2010-12-24 Thread jlmagc
Can't be done. The HttpServletResponse does not provide a method to check if 
there is already a cookie on the request. And I need to put the cookie 
generated by the last action,  not the first one.
Sent via BlackBerry from T-Mobile

-Original Message-
From: Dave Newton 
Date: Fri, 24 Dec 2010 07:47:59 
To: Struts Users Mailing List
Reply-To: "Struts Users Mailing List" 
Subject: Re: How to avoid PreResultListener called twice in action chaining

Check to see if it's already there?

On Fri, Dec 24, 2010 at 7:04 AM, JOSE L MARTINEZ-AVIAL wrote:

> Hello all,
>  I've developed an interceptor to add cookies to the response. It works as
> follows:
> [..]
>public String intercept(ActionInvocation invocation) throws Exception {
>invocation.addPreResultListener(this);
>return invocation.invoke();
>}
>
>  public void beforeResult(ActionInvocation invocation, String resultCode) {
>//log.debug("beforeResult start");
>ActionContext ac = invocation.getInvocationContext();
>HttpServletResponse response = (HttpServletResponse)
> ac.get(StrutsStatics.HTTP_RESPONSE);
>addCookiesToResponse(invocation.getAction(), response);
>//log.debug("beforeResult end");
>}
>private void addCookiesToResponse(Object action, HttpServletResponse
> response) {
>//log.info("CookieProviderInterceptor "+action);
>if (action instanceof CookieProvider) {
>
>
>Map cookies = ((CookieProvider)
> action).getCookies();
>//log.info("CookieProviderInterceptor "+cookies);
>
>if (cookies != null) {
>Set> cookieSet =
> cookies.entrySet();
>for (Entry entry : cookieSet) {
>CookieBean cookiebean = entry.getValue();
>Cookie cookie = new Cookie(cookiebean.getCookieName(),
> cookiebean.getCookieValue());
>cookie.setMaxAge(cookiebean.getMaxAge());
>cookie.setComment(cookiebean.getComment());
>if (cookiebean.getDomain()!=null)
>cookie.setDomain(cookiebean.getDomain());
>cookie.setPath(cookiebean.getPath());
>cookie.setSecure(cookiebean.getSecure());
>cookie.setVersion(cookiebean.getVersion());
>//log.info("adding "+cookie);
>response.addCookie(cookie);
>}
>}
>}
>}
>
> So the idea is that the Action implements CookieProvider, returning a map
> of
> cookies, and put the cookies in the response. It works well, but I'm having
> some problems when I chain two actions, if both of them are CookieProvider,
> and both return a cookie with the same name. My idea was be that the first
> cookie would be overwritten by the second one, but in fact the response has
> both cookies, with the same name. After giving it a thought, it makes
> sense,
> so probably I'm doing something wrong. Any insight on how to do this?
>
> TIA
>
> Jose Luis
>



Re: How to avoid PreResultListener called twice in action chaining

2010-12-24 Thread Dave Newton
Check to see if it's already there?

On Fri, Dec 24, 2010 at 7:04 AM, JOSE L MARTINEZ-AVIAL wrote:

> Hello all,
>  I've developed an interceptor to add cookies to the response. It works as
> follows:
> [..]
>public String intercept(ActionInvocation invocation) throws Exception {
>invocation.addPreResultListener(this);
>return invocation.invoke();
>}
>
>  public void beforeResult(ActionInvocation invocation, String resultCode) {
>//log.debug("beforeResult start");
>ActionContext ac = invocation.getInvocationContext();
>HttpServletResponse response = (HttpServletResponse)
> ac.get(StrutsStatics.HTTP_RESPONSE);
>addCookiesToResponse(invocation.getAction(), response);
>//log.debug("beforeResult end");
>}
>private void addCookiesToResponse(Object action, HttpServletResponse
> response) {
>//log.info("CookieProviderInterceptor "+action);
>if (action instanceof CookieProvider) {
>
>
>Map cookies = ((CookieProvider)
> action).getCookies();
>//log.info("CookieProviderInterceptor "+cookies);
>
>if (cookies != null) {
>Set> cookieSet =
> cookies.entrySet();
>for (Entry entry : cookieSet) {
>CookieBean cookiebean = entry.getValue();
>Cookie cookie = new Cookie(cookiebean.getCookieName(),
> cookiebean.getCookieValue());
>cookie.setMaxAge(cookiebean.getMaxAge());
>cookie.setComment(cookiebean.getComment());
>if (cookiebean.getDomain()!=null)
>cookie.setDomain(cookiebean.getDomain());
>cookie.setPath(cookiebean.getPath());
>cookie.setSecure(cookiebean.getSecure());
>cookie.setVersion(cookiebean.getVersion());
>//log.info("adding "+cookie);
>response.addCookie(cookie);
>}
>}
>}
>}
>
> So the idea is that the Action implements CookieProvider, returning a map
> of
> cookies, and put the cookies in the response. It works well, but I'm having
> some problems when I chain two actions, if both of them are CookieProvider,
> and both return a cookie with the same name. My idea was be that the first
> cookie would be overwritten by the second one, but in fact the response has
> both cookies, with the same name. After giving it a thought, it makes
> sense,
> so probably I'm doing something wrong. Any insight on how to do this?
>
> TIA
>
> Jose Luis
>


How to avoid PreResultListener called twice in action chaining

2010-12-24 Thread JOSE L MARTINEZ-AVIAL
Hello all,
  I've developed an interceptor to add cookies to the response. It works as
follows:
[..]
public String intercept(ActionInvocation invocation) throws Exception {
invocation.addPreResultListener(this);
return invocation.invoke();
}

  public void beforeResult(ActionInvocation invocation, String resultCode) {
//log.debug("beforeResult start");
ActionContext ac = invocation.getInvocationContext();
HttpServletResponse response = (HttpServletResponse)
ac.get(StrutsStatics.HTTP_RESPONSE);
addCookiesToResponse(invocation.getAction(), response);
//log.debug("beforeResult end");
}
private void addCookiesToResponse(Object action, HttpServletResponse
response) {
//log.info("CookieProviderInterceptor "+action);
if (action instanceof CookieProvider) {


Map cookies = ((CookieProvider)
action).getCookies();
//log.info("CookieProviderInterceptor "+cookies);

if (cookies != null) {
Set> cookieSet =
cookies.entrySet();
for (Entry entry : cookieSet) {
CookieBean cookiebean = entry.getValue();
Cookie cookie = new Cookie(cookiebean.getCookieName(),
cookiebean.getCookieValue());
cookie.setMaxAge(cookiebean.getMaxAge());
cookie.setComment(cookiebean.getComment());
if (cookiebean.getDomain()!=null)
cookie.setDomain(cookiebean.getDomain());
cookie.setPath(cookiebean.getPath());
cookie.setSecure(cookiebean.getSecure());
cookie.setVersion(cookiebean.getVersion());
//log.info("adding "+cookie);
response.addCookie(cookie);
}
}
}
}

So the idea is that the Action implements CookieProvider, returning a map of
cookies, and put the cookies in the response. It works well, but I'm having
some problems when I chain two actions, if both of them are CookieProvider,
and both return a cookie with the same name. My idea was be that the first
cookie would be overwritten by the second one, but in fact the response has
both cookies, with the same name. After giving it a thought, it makes sense,
so probably I'm doing something wrong. Any insight on how to do this?

TIA

Jose Luis


Re: Convention Plugin - Action Chaining

2009-12-11 Thread Musachy Barroso
So it is finding a jsp that it think it is the result, that's why it
is not doing the forward.

On Fri, Dec 11, 2009 at 1:48 AM, RogerV  wrote:
>
>
>
> Musachy Barroso wrote:
>>
>> If they are in the same package that should work, all I can advise is
>> to put a breakpoint in ConventionUnknownHandler, line 301 and see what
>> is going on.
>>
>
> Hi Musachy
>
> At line 301 if (result == null && resultCode != null) result is an instance
> of ServletDispatcherResult with a location attribute of
> /WEB-INF/content/foo.jsp and resultCode is a string with value "bar". The
> comparison fails and jumps to line 317 returning /WEB-INF/content/foo.jsp
>
> Regards
>
> --
> View this message in context: 
> http://old.nabble.com/Convention-Plugin---Action-Chaining-tp26728788p26741424.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Convention Plugin - Action Chaining

2009-12-11 Thread RogerV



Musachy Barroso wrote:
> 
> If they are in the same package that should work, all I can advise is
> to put a breakpoint in ConventionUnknownHandler, line 301 and see what
> is going on.
> 

Hi Musachy

At line 301 if (result == null && resultCode != null) result is an instance
of ServletDispatcherResult with a location attribute of
/WEB-INF/content/foo.jsp and resultCode is a string with value "bar". The
comparison fails and jumps to line 317 returning /WEB-INF/content/foo.jsp

Regards

-- 
View this message in context: 
http://old.nabble.com/Convention-Plugin---Action-Chaining-tp26728788p26741424.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Convention Plugin - Action Chaining

2009-12-10 Thread Musachy Barroso
If they are in the same package that should work, all I can advise is
to put a breakpoint in ConventionUnknownHandler, line 301 and see what
is going on.

musachy

On Thu, Dec 10, 2009 at 7:10 AM, RogerV  wrote:
>
> I'm trying to get action chaining to work as described in the section
> chaining at http://struts.apache.org/2.1.6/docs/convention-plugin.html. My
> Foo action and bar actions are listed below. What happens is that when Foo
> is called, it correctly displays foo.jsp. When foo.jsp is submitted it fills
> in the value of platformId, I see the message "Platform selected" on the
> console and then foo.jsp is redisplayed and I don't see the message "Foo-Bar
> is called". If I change return "bar" to a nonsense string that doesn't refer
> to anything, I still get foo.jsp redisplayed when I would expect a "No
> Result Defined for Action Foo and result " exception.
>
> Any idea what I'm doing wrong?
>
> Regards
>
> public class Foo extends ActionSupport {
>
>        private int platformId;
>        private Services services;
>
>        public String execute() {
>
>                System.out.println("SelectPlatform.execute()");
>                if (platformId > 0) {
>                        System.out.println("Platform selected");
>                        return "bar";
>                }
>
>                return SUCCESS;
>        }
>
>        public  List getPlatforms() {
>                return services.listAllPlatforms();
>            }
>
>        public int getPlatformId() {
>                return platformId;
>        }
>
>        public void setPlatformId(int platformId) {
>                this.platformId = platformId;
>        }
> }
>
> public class EditPlatformData extends BaseAction {
>
>        private int platformId;
>
> @Action("foo-bar")
>        public String execute() {
>                System.out.println("Foo-Bar is called");
>                return SUCCESS;
>        }
>
>        public int getPlatformId() {
>                return platformId;
>        }
>
>        public void setPlatformId(int platformId) {
>                this.platformId = platformId;
>        }
> }
> --
> View this message in context: 
> http://old.nabble.com/Convention-Plugin---Action-Chaining-tp26728788p26728788.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Convention Plugin - Action Chaining

2009-12-10 Thread RogerV

I'm trying to get action chaining to work as described in the section
chaining at http://struts.apache.org/2.1.6/docs/convention-plugin.html. My
Foo action and bar actions are listed below. What happens is that when Foo
is called, it correctly displays foo.jsp. When foo.jsp is submitted it fills
in the value of platformId, I see the message "Platform selected" on the
console and then foo.jsp is redisplayed and I don't see the message "Foo-Bar
is called". If I change return "bar" to a nonsense string that doesn't refer
to anything, I still get foo.jsp redisplayed when I would expect a "No
Result Defined for Action Foo and result " exception.

Any idea what I'm doing wrong?

Regards

public class Foo extends ActionSupport {

private int platformId;
private Services services;

public String execute() {

System.out.println("SelectPlatform.execute()");
if (platformId > 0) {
System.out.println("Platform selected");
return "bar";
}

return SUCCESS;
}

public  List getPlatforms() {
return services.listAllPlatforms();
}

public int getPlatformId() {
return platformId;
}

public void setPlatformId(int platformId) {
this.platformId = platformId;
}
}

public class EditPlatformData extends BaseAction {

private int platformId;

@Action("foo-bar")
public String execute() {
System.out.println("Foo-Bar is called");
return SUCCESS;
}

public int getPlatformId() {
return platformId;
}

public void setPlatformId(int platformId) {
this.platformId = platformId;
}
}
-- 
View this message in context: 
http://old.nabble.com/Convention-Plugin---Action-Chaining-tp26728788p26728788.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



AW: Issue in Action Chaining

2009-04-22 Thread Anastasios Patrikis
Hi Satya,

in our project we have a base action with methods to read/write session 
attributes:

ServletActionContext.getRequest().getSession.getAttribute(name)
ServletActionContext.getRequest().getSession.setAttribute(name, object)

This may help.

Regards,

Anastasios.


-Ursprüngliche Nachricht-
Von: satyanarayana katta [mailto:saty.pra...@gmail.com] 
Gesendet: Mittwoch, 22. April 2009 08:04
An: Struts Users Mailing List; w...@wantii.com
Betreff: Re: Issue in Action Chaining

Hi Wesw,
I also tried printing the object address and what you said is right!!  It is
creating a new object.  The object address is not same.  Is there any other
way of passing the data to the chained method?

I want to use the redirect as the last option!!

Rgds,

Satya

On Tue, Apr 21, 2009 at 10:22 PM, satyanarayana katta  wrote:

> Hi Wesw,
> Thanks for the reply.  Yes, I meant to say testChain().  Thanks for that.
>
> So, how is the old data being retained.  Does it take it from the http
> request and recreates the new instance?
>
> If that is the case, what other options do I have to get the changed data
> into the chained method?
>
> Thanks
>
> Satya
>
>
> On Tue, Apr 21, 2009 at 9:55 PM, Wes Wannemacher  wrote:
>
>> On Wednesday 22 April 2009 00:36:36 satyanarayana katta wrote:
>> > Hi All,
>> > I have a Action class
>> >
>> > class BaseAction extends ActionSupport {
>> > private Sting data;
>> >
>> > public void getData() {
>> > return this.data;
>> > }
>> >
>> >public String setData(String data){
>> >this.data = data;
>> >}
>> > }
>> >
>> > class Action extends BaseAction{
>> > public String execute() throws Exception {
>> > System.out.println(getData());
>> > setData("abc");
>> > return "chain";
>> > }
>> >
>> > public String executeChain() throws Exception {
>> > System.out.println(getData());
>> > return "success"
>> > }
>> > }
>> >
>> > xml configuration:
>> >
>> > 
>> > test2
>> > 
>> >
>> > 
>> > 
>> > 
>> >
>> >
>> >
>> > http://localhost:8080/test/test.action?data=ball
>> >
>> > Output of execute:  ball
>> > Output of execute1:  ball
>> >
>> > I am expecting the out of execute1 as "abc"
>> >
>> > Am I missing something please help me resolve the issue.
>> >
>> > Rgds,
>> >
>> > Satya
>>
>> The configuration of test2 points to method execute1, but your action has
>> executeChain(). I assume that's a typo. My (somewhat educated) guess is
>> that
>> when you chain to the next action, even though it is the same class, a new
>> instance is created. In the new instance, setData(String) is never called
>> since it is only called in the execute method.
>>
>> -Wes
>> --
>>
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

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



Re: Issue in Action Chaining

2009-04-21 Thread satyanarayana katta
Hi Wesw,
I also tried printing the object address and what you said is right!!  It is
creating a new object.  The object address is not same.  Is there any other
way of passing the data to the chained method?

I want to use the redirect as the last option!!

Rgds,

Satya

On Tue, Apr 21, 2009 at 10:22 PM, satyanarayana katta  wrote:

> Hi Wesw,
> Thanks for the reply.  Yes, I meant to say testChain().  Thanks for that.
>
> So, how is the old data being retained.  Does it take it from the http
> request and recreates the new instance?
>
> If that is the case, what other options do I have to get the changed data
> into the chained method?
>
> Thanks
>
> Satya
>
>
> On Tue, Apr 21, 2009 at 9:55 PM, Wes Wannemacher  wrote:
>
>> On Wednesday 22 April 2009 00:36:36 satyanarayana katta wrote:
>> > Hi All,
>> > I have a Action class
>> >
>> > class BaseAction extends ActionSupport {
>> > private Sting data;
>> >
>> > public void getData() {
>> > return this.data;
>> > }
>> >
>> >public String setData(String data){
>> >this.data = data;
>> >}
>> > }
>> >
>> > class Action extends BaseAction{
>> > public String execute() throws Exception {
>> > System.out.println(getData());
>> > setData("abc");
>> > return "chain";
>> > }
>> >
>> > public String executeChain() throws Exception {
>> > System.out.println(getData());
>> > return "success"
>> > }
>> > }
>> >
>> > xml configuration:
>> >
>> > 
>> > test2
>> > 
>> >
>> > 
>> > 
>> > 
>> >
>> >
>> >
>> > http://localhost:8080/test/test.action?data=ball
>> >
>> > Output of execute:  ball
>> > Output of execute1:  ball
>> >
>> > I am expecting the out of execute1 as "abc"
>> >
>> > Am I missing something please help me resolve the issue.
>> >
>> > Rgds,
>> >
>> > Satya
>>
>> The configuration of test2 points to method execute1, but your action has
>> executeChain(). I assume that's a typo. My (somewhat educated) guess is
>> that
>> when you chain to the next action, even though it is the same class, a new
>> instance is created. In the new instance, setData(String) is never called
>> since it is only called in the execute method.
>>
>> -Wes
>> --
>>
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: Issue in Action Chaining

2009-04-21 Thread satyanarayana katta
No it doesn't work.  Chain is not accepting any of the parameters strings.
 Its going to the global error page directly.
Rgds,

Satya

On Tue, Apr 21, 2009 at 10:22 PM, Nils-Helge Garli Hegvik
wrote:

> I'm not sure if this applies to the chain result, but you could give
> it a shot:
> http://struts.apache.org/2.1.6/docs/parameters-in-configuration-results.html
>
> Nils-H
>
> On Wed, Apr 22, 2009 at 6:36 AM, satyanarayana katta
>  wrote:
> > Hi All,
> > I have a Action class
> >
> > class BaseAction extends ActionSupport {
> >private Sting data;
> >
> >public void getData() {
> >return this.data;
> >}
> >
> >   public String setData(String data){
> >   this.data = data;
> >   }
> > }
> >
> > class Action extends BaseAction{
> >public String execute() throws Exception {
> >System.out.println(getData());
> >setData("abc");
> >return "chain";
> >}
> >
> >public String executeChain() throws Exception {
> >System.out.println(getData());
> >return "success"
> >}
> > }
> >
> > xml configuration:
> >
> > 
> > test2
> > 
> >
> > 
> > 
> > 
> >
> >
> >
> > http://localhost:8080/test/test.action?data=ball
> >
> > Output of execute:  ball
> > Output of execute1:  ball
> >
> > I am expecting the out of execute1 as "abc"
> >
> > Am I missing something please help me resolve the issue.
> >
> > Rgds,
> >
> > Satya
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Issue in Action Chaining

2009-04-21 Thread satyanarayana katta
Hi Wesw,
Thanks for the reply.  Yes, I meant to say testChain().  Thanks for that.

So, how is the old data being retained.  Does it take it from the http
request and recreates the new instance?

If that is the case, what other options do I have to get the changed data
into the chained method?

Thanks

Satya

On Tue, Apr 21, 2009 at 9:55 PM, Wes Wannemacher  wrote:

> On Wednesday 22 April 2009 00:36:36 satyanarayana katta wrote:
> > Hi All,
> > I have a Action class
> >
> > class BaseAction extends ActionSupport {
> > private Sting data;
> >
> > public void getData() {
> > return this.data;
> > }
> >
> >public String setData(String data){
> >this.data = data;
> >}
> > }
> >
> > class Action extends BaseAction{
> > public String execute() throws Exception {
> > System.out.println(getData());
> > setData("abc");
> > return "chain";
> > }
> >
> > public String executeChain() throws Exception {
> > System.out.println(getData());
> > return "success"
> > }
> > }
> >
> > xml configuration:
> >
> > 
> > test2
> > 
> >
> > 
> > 
> > 
> >
> >
> >
> > http://localhost:8080/test/test.action?data=ball
> >
> > Output of execute:  ball
> > Output of execute1:  ball
> >
> > I am expecting the out of execute1 as "abc"
> >
> > Am I missing something please help me resolve the issue.
> >
> > Rgds,
> >
> > Satya
>
> The configuration of test2 points to method execute1, but your action has
> executeChain(). I assume that's a typo. My (somewhat educated) guess is
> that
> when you chain to the next action, even though it is the same class, a new
> instance is created. In the new instance, setData(String) is never called
> since it is only called in the execute method.
>
> -Wes
> --
>
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Issue in Action Chaining

2009-04-21 Thread Nils-Helge Garli Hegvik
I'm not sure if this applies to the chain result, but you could give
it a shot: 
http://struts.apache.org/2.1.6/docs/parameters-in-configuration-results.html

Nils-H

On Wed, Apr 22, 2009 at 6:36 AM, satyanarayana katta
 wrote:
> Hi All,
> I have a Action class
>
> class BaseAction extends ActionSupport {
>    private Sting data;
>
>    public void getData() {
>        return this.data;
>    }
>
>   public String setData(String data){
>       this.data = data;
>   }
> }
>
> class Action extends BaseAction{
>    public String execute() throws Exception {
>        System.out.println(getData());
>        setData("abc");
>        return "chain";
>    }
>
>    public String executeChain() throws Exception {
>        System.out.println(getData());
>        return "success"
>    }
> }
>
> xml configuration:
>
> 
> test2
> 
>
> 
> 
> 
>
>
>
> http://localhost:8080/test/test.action?data=ball
>
> Output of execute:  ball
> Output of execute1:  ball
>
> I am expecting the out of execute1 as "abc"
>
> Am I missing something please help me resolve the issue.
>
> Rgds,
>
> Satya
>

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



Re: Issue in Action Chaining

2009-04-21 Thread Wes Wannemacher
On Wednesday 22 April 2009 00:36:36 satyanarayana katta wrote:
> Hi All,
> I have a Action class
>
> class BaseAction extends ActionSupport {
> private Sting data;
>
> public void getData() {
> return this.data;
> }
>
>public String setData(String data){
>this.data = data;
>}
> }
>
> class Action extends BaseAction{
> public String execute() throws Exception {
> System.out.println(getData());
> setData("abc");
> return "chain";
> }
>
> public String executeChain() throws Exception {
> System.out.println(getData());
> return "success"
> }
> }
>
> xml configuration:
>
> 
> test2
> 
>
> 
> 
> 
>
>
>
> http://localhost:8080/test/test.action?data=ball
>
> Output of execute:  ball
> Output of execute1:  ball
>
> I am expecting the out of execute1 as "abc"
>
> Am I missing something please help me resolve the issue.
>
> Rgds,
>
> Satya

The configuration of test2 points to method execute1, but your action has 
executeChain(). I assume that's a typo. My (somewhat educated) guess is that 
when you chain to the next action, even though it is the same class, a new 
instance is created. In the new instance, setData(String) is never called 
since it is only called in the execute method. 

-Wes
-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


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



Issue in Action Chaining

2009-04-21 Thread satyanarayana katta
Hi All,
I have a Action class

class BaseAction extends ActionSupport {
private Sting data;

public void getData() {
return this.data;
}

   public String setData(String data){
   this.data = data;
   }
}

class Action extends BaseAction{
public String execute() throws Exception {
System.out.println(getData());
setData("abc");
return "chain";
}

public String executeChain() throws Exception {
System.out.println(getData());
return "success"
}
}

xml configuration:


test2








http://localhost:8080/test/test.action?data=ball

Output of execute:  ball
Output of execute1:  ball

I am expecting the out of execute1 as "abc"

Am I missing something please help me resolve the issue.

Rgds,

Satya


RE: Convention Plugin and Action Chaining

2009-03-10 Thread Russo, Joe
Sorry about that.

-Original Message-
From: Musachy Barroso [mailto:musa...@gmail.com] 
Sent: Tuesday, March 10, 2009 2:28 PM
To: Struts Users Mailing List
Subject: Re: Convention Plugin and Action Chaining

By "convention" you should not "chain" your questions into an existing
thread on another topic :)

musachy

On Tue, Mar 10, 2009 at 2:25 PM, Russo, Joe  wrote:
> I defined the below code and would like to use the iterate functionality
> witin the jsp.  This code does not cause any error, but does not display
> any data.  Any ideas why?
>
> package com.cadmus.rpm.domain.custom;
>
> import java.io.Serializable;
> import java.util.Date;
> import java.util.ArrayList;
>
>
> public class AuthorsCDTO implements Serializable {
> private String addAuthorFirstName;
> private String addAuthorLastName;
> private String addAuthorMiddleInitial;
> public String getAddAuthorFirstName() {
>        return addAuthorFirstName;
> }
> public void setAddAuthorFirstName(String addAuthorFirstName) {
>        this.addAuthorFirstName = addAuthorFirstName;
> }
> public String getAddAuthorLastName() {
>        return addAuthorLastName;
> }
> public void setAddAuthorLastName(String addAuthorLastName) {
>        this.addAuthorLastName = addAuthorLastName;
> }
> public String getAddAuthorMiddleInitial() {
>        return addAuthorMiddleInitial;
> }
> public void setAddAuthorMiddleInitial(String addAuthorMiddleInitial) {
>        this.addAuthorMiddleInitial = addAuthorMiddleInitial;
> }
>
>
> }
>
> private ArrayList allAdditionalAuthors;
> public ArrayList getAllAdditionalAuthors() {
>        return allAdditionalAuthors;
> }
> public void setAllAdditionalAuthors(ArrayList allAdditionalAuthors) {
>        this.allAdditionalAuthors = allAdditionalAuthors;
> }
>
>  scope="session">
>       property="allAdditionalAuthors"
>      type="com.cadmus.rpm.domain.custom.AuthorsCDTO" scope="session">
> 
>        
>                 property="addAuthorFirstName"/>
>        
>        
>                 property="addAuthorMiddleInitial"/>
>        
>                 property="addAuthorLastName"/>
>        
> 
> 
> 
>
> 
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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






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



Re: Convention Plugin and Action Chaining

2009-03-10 Thread Musachy Barroso
By "convention" you should not "chain" your questions into an existing
thread on another topic :)

musachy

On Tue, Mar 10, 2009 at 2:25 PM, Russo, Joe  wrote:
> I defined the below code and would like to use the iterate functionality
> witin the jsp.  This code does not cause any error, but does not display
> any data.  Any ideas why?
>
> package com.cadmus.rpm.domain.custom;
>
> import java.io.Serializable;
> import java.util.Date;
> import java.util.ArrayList;
>
>
> public class AuthorsCDTO implements Serializable {
> private String addAuthorFirstName;
> private String addAuthorLastName;
> private String addAuthorMiddleInitial;
> public String getAddAuthorFirstName() {
>        return addAuthorFirstName;
> }
> public void setAddAuthorFirstName(String addAuthorFirstName) {
>        this.addAuthorFirstName = addAuthorFirstName;
> }
> public String getAddAuthorLastName() {
>        return addAuthorLastName;
> }
> public void setAddAuthorLastName(String addAuthorLastName) {
>        this.addAuthorLastName = addAuthorLastName;
> }
> public String getAddAuthorMiddleInitial() {
>        return addAuthorMiddleInitial;
> }
> public void setAddAuthorMiddleInitial(String addAuthorMiddleInitial) {
>        this.addAuthorMiddleInitial = addAuthorMiddleInitial;
> }
>
>
> }
>
> private ArrayList allAdditionalAuthors;
> public ArrayList getAllAdditionalAuthors() {
>        return allAdditionalAuthors;
> }
> public void setAllAdditionalAuthors(ArrayList allAdditionalAuthors) {
>        this.allAdditionalAuthors = allAdditionalAuthors;
> }
>
>  scope="session">
>       property="allAdditionalAuthors"
>      type="com.cadmus.rpm.domain.custom.AuthorsCDTO" scope="session">
> 
>        
>                 property="addAuthorFirstName"/>
>        
>        
>                 property="addAuthorMiddleInitial"/>
>        
>                 property="addAuthorLastName"/>
>        
> 
> 
> 
>
> 
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



RE: Convention Plugin and Action Chaining

2009-03-10 Thread Russo, Joe
I defined the below code and would like to use the iterate functionality
witin the jsp.  This code does not cause any error, but does not display
any data.  Any ideas why?

package com.cadmus.rpm.domain.custom;

import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;


public class AuthorsCDTO implements Serializable {
private String addAuthorFirstName;
private String addAuthorLastName;
private String addAuthorMiddleInitial;
public String getAddAuthorFirstName() {
return addAuthorFirstName;
}
public void setAddAuthorFirstName(String addAuthorFirstName) {
this.addAuthorFirstName = addAuthorFirstName;
}
public String getAddAuthorLastName() {
return addAuthorLastName;
}
public void setAddAuthorLastName(String addAuthorLastName) {
this.addAuthorLastName = addAuthorLastName;
}
public String getAddAuthorMiddleInitial() {
return addAuthorMiddleInitial;
}
public void setAddAuthorMiddleInitial(String addAuthorMiddleInitial) {
this.addAuthorMiddleInitial = addAuthorMiddleInitial;
}


}

private ArrayList allAdditionalAuthors;
public ArrayList getAllAdditionalAuthors() {
return allAdditionalAuthors;
}
public void setAllAdditionalAuthors(ArrayList allAdditionalAuthors) {
this.allAdditionalAuthors = allAdditionalAuthors;
}


















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



Re: Convention Plugin and Action Chaining

2009-03-10 Thread Edward Song
Thanks Musachy, I fully understand now.  I appreciate your help.

On Tue, Mar 10, 2009 at 1:54 PM, Musachy Barroso  wrote:

> If the result is "get" and the source action is target is "save", then
> the "target" action has to be "save-get" (yours is "get").
>
> musachy
>
> On Tue, Mar 10, 2009 at 1:42 PM, Edward Song 
> wrote:
> > Thanks Musachy for your prompt response.
> >
> > Makes total sense.
> >
> > However, I now tried the following based on your reply
> >
> > GetAction.execute() returns ActionSupport.SUCCESS.
> > forwards to
> > get-success.jsp  (renamed get.jsp, so that it would not be found in the
> > instance below)
> >
> > SaveAction.execute() returns "get"  (in hopes of chaining GetAction)
> >
> > However, after SaveAction.execute(), I get an exception stating that the
> > result "get" is not found.
> > "No result defined for action com.company.web.actions.SaveAction and
> result
> > get"
> >
> > Note that, both of these guys are in the same package, and therefore in
> the
> > same namespace.
> > Through the config-browser, I did verify that "get" is not one of the
> listed
> > result types not found.
> >
> > Ed
> >
> >
> >
> > On Tue, Mar 10, 2009 at 12:19 PM, Musachy Barroso 
> wrote:
> >
> >> The problem in your case, is that Convention tries to find
> >> "get-get.jsp" and then tries "get.jsp", which it will find, so it will
> >> never chain to the action, but rather dispatch to the jsp. Chaining
> >> only works when no result is found.
> >>
> >> musahcy
> >>
> >> On Tue, Mar 10, 2009 at 12:12 PM, Musachy Barroso 
> >> wrote:
> >> > Yes, you can chain actions if they are in the same package:
> >> >
> >> >
> >>
> http://cwiki.apache.org/WW/convention-plugin.html#ConventionPlugin-Chaining
> >> >
> >> > musachy
> >> >
> >> > On Tue, Mar 10, 2009 at 11:52 AM, Edward Song
> >> >  wrote:
> >> >> Hi all,
> >> >>
> >> >> This question concerns the Convention Plugin, specifically in regards
> to
> >> >> Action Chaining.
> >> >>
> >> >> I am using Struts 2.1.6
> >> >>
> >> >> I have the following package structure.
> >> >>
> >> >>  com.company.web.actions.administrators.GetAction
> >> >> (/administrators/get)
> >> >>  com.company.web.actions.administrators.SaveAction
> >> >> (/administrators/save)
> >> >>
> >> >> After SaveAction.execute(), I wanted to use action chaining and
> forward
> >> >> to GetAction.execute().
> >> >>
> >> >> I was able to get this to work via annotations in my SaveAction
> class.
> >>  The
> >> >> execute() method returns ActionSupport.SUCCESS.
> >> >>
> >> >> @Results({
> >> >>
> >> >> @Result(name=ActionSupport.*SUCCESS*, type="chain", location="get")
> >> >>
> >> >> })
> >> >> However, it seems through the examples, that annotations may not be
> >> required
> >> >> for simple action chaining.
> >> >> Can we return an action name, effectively chainining the actions
> >> together?
> >> >> I had attempted returning "get" in my SaveAction.execute(), thinking
> >> that it
> >> >> would action chain GetAction.
> >> >> The result was forwarded to my
> /WEB-INF/content/administrators/get.jsp,
> >> but
> >> >> never actually ran GetAction.execute() .
> >> >>
> >> >> Any idea as to what my SaveAction.execute() method should return to
> >> >> accomplish simple action chaining without the annotation above?
> >> >>
> >> >> Thank you in advance.
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >> >
> >>
> >>
> >>
> >> --
> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
>
>
>
> --
>  "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Regards,
Edward Song
Java Web Developer
631-396-5000 x306


Re: Convention Plugin and Action Chaining

2009-03-10 Thread Musachy Barroso
If the result is "get" and the source action is target is "save", then
the "target" action has to be "save-get" (yours is "get").

musachy

On Tue, Mar 10, 2009 at 1:42 PM, Edward Song  wrote:
> Thanks Musachy for your prompt response.
>
> Makes total sense.
>
> However, I now tried the following based on your reply
>
> GetAction.execute() returns ActionSupport.SUCCESS.
> forwards to
> get-success.jsp  (renamed get.jsp, so that it would not be found in the
> instance below)
>
> SaveAction.execute() returns "get"  (in hopes of chaining GetAction)
>
> However, after SaveAction.execute(), I get an exception stating that the
> result "get" is not found.
> "No result defined for action com.company.web.actions.SaveAction and result
> get"
>
> Note that, both of these guys are in the same package, and therefore in the
> same namespace.
> Through the config-browser, I did verify that "get" is not one of the listed
> result types not found.
>
> Ed
>
>
>
> On Tue, Mar 10, 2009 at 12:19 PM, Musachy Barroso  wrote:
>
>> The problem in your case, is that Convention tries to find
>> "get-get.jsp" and then tries "get.jsp", which it will find, so it will
>> never chain to the action, but rather dispatch to the jsp. Chaining
>> only works when no result is found.
>>
>> musahcy
>>
>> On Tue, Mar 10, 2009 at 12:12 PM, Musachy Barroso 
>> wrote:
>> > Yes, you can chain actions if they are in the same package:
>> >
>> >
>> http://cwiki.apache.org/WW/convention-plugin.html#ConventionPlugin-Chaining
>> >
>> > musachy
>> >
>> > On Tue, Mar 10, 2009 at 11:52 AM, Edward Song
>> >  wrote:
>> >> Hi all,
>> >>
>> >> This question concerns the Convention Plugin, specifically in regards to
>> >> Action Chaining.
>> >>
>> >> I am using Struts 2.1.6
>> >>
>> >> I have the following package structure.
>> >>
>> >>  com.company.web.actions.administrators.GetAction
>> >> (/administrators/get)
>> >>  com.company.web.actions.administrators.SaveAction
>> >> (/administrators/save)
>> >>
>> >> After SaveAction.execute(), I wanted to use action chaining and forward
>> >> to GetAction.execute().
>> >>
>> >> I was able to get this to work via annotations in my SaveAction class.
>>  The
>> >> execute() method returns ActionSupport.SUCCESS.
>> >>
>> >> @Results({
>> >>
>> >> @Result(name=ActionSupport.*SUCCESS*, type="chain", location="get")
>> >>
>> >> })
>> >> However, it seems through the examples, that annotations may not be
>> required
>> >> for simple action chaining.
>> >> Can we return an action name, effectively chainining the actions
>> together?
>> >> I had attempted returning "get" in my SaveAction.execute(), thinking
>> that it
>> >> would action chain GetAction.
>> >> The result was forwarded to my /WEB-INF/content/administrators/get.jsp,
>> but
>> >> never actually ran GetAction.execute() .
>> >>
>> >> Any idea as to what my SaveAction.execute() method should return to
>> >> accomplish simple action chaining without the annotation above?
>> >>
>> >> Thank you in advance.
>> >>
>> >
>> >
>> >
>> > --
>> > "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



Re: Convention Plugin and Action Chaining

2009-03-10 Thread Edward Song
Thanks Musachy for your prompt response.

Makes total sense.

However, I now tried the following based on your reply

GetAction.execute() returns ActionSupport.SUCCESS.
forwards to
get-success.jsp  (renamed get.jsp, so that it would not be found in the
instance below)

SaveAction.execute() returns "get"  (in hopes of chaining GetAction)

However, after SaveAction.execute(), I get an exception stating that the
result "get" is not found.
"No result defined for action com.company.web.actions.SaveAction and result
get"

Note that, both of these guys are in the same package, and therefore in the
same namespace.
Through the config-browser, I did verify that "get" is not one of the listed
result types not found.

Ed



On Tue, Mar 10, 2009 at 12:19 PM, Musachy Barroso  wrote:

> The problem in your case, is that Convention tries to find
> "get-get.jsp" and then tries "get.jsp", which it will find, so it will
> never chain to the action, but rather dispatch to the jsp. Chaining
> only works when no result is found.
>
> musahcy
>
> On Tue, Mar 10, 2009 at 12:12 PM, Musachy Barroso 
> wrote:
> > Yes, you can chain actions if they are in the same package:
> >
> >
> http://cwiki.apache.org/WW/convention-plugin.html#ConventionPlugin-Chaining
> >
> > musachy
> >
> > On Tue, Mar 10, 2009 at 11:52 AM, Edward Song
> >  wrote:
> >> Hi all,
> >>
> >> This question concerns the Convention Plugin, specifically in regards to
> >> Action Chaining.
> >>
> >> I am using Struts 2.1.6
> >>
> >> I have the following package structure.
> >>
> >>  com.company.web.actions.administrators.GetAction
> >> (/administrators/get)
> >>  com.company.web.actions.administrators.SaveAction
> >> (/administrators/save)
> >>
> >> After SaveAction.execute(), I wanted to use action chaining and forward
> >> to GetAction.execute().
> >>
> >> I was able to get this to work via annotations in my SaveAction class.
>  The
> >> execute() method returns ActionSupport.SUCCESS.
> >>
> >> @Results({
> >>
> >> @Result(name=ActionSupport.*SUCCESS*, type="chain", location="get")
> >>
> >> })
> >> However, it seems through the examples, that annotations may not be
> required
> >> for simple action chaining.
> >> Can we return an action name, effectively chainining the actions
> together?
> >> I had attempted returning "get" in my SaveAction.execute(), thinking
> that it
> >> would action chain GetAction.
> >> The result was forwarded to my /WEB-INF/content/administrators/get.jsp,
> but
> >> never actually ran GetAction.execute() .
> >>
> >> Any idea as to what my SaveAction.execute() method should return to
> >> accomplish simple action chaining without the annotation above?
> >>
> >> Thank you in advance.
> >>
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Convention Plugin and Action Chaining

2009-03-10 Thread Musachy Barroso
The problem in your case, is that Convention tries to find
"get-get.jsp" and then tries "get.jsp", which it will find, so it will
never chain to the action, but rather dispatch to the jsp. Chaining
only works when no result is found.

musahcy

On Tue, Mar 10, 2009 at 12:12 PM, Musachy Barroso  wrote:
> Yes, you can chain actions if they are in the same package:
>
> http://cwiki.apache.org/WW/convention-plugin.html#ConventionPlugin-Chaining
>
> musachy
>
> On Tue, Mar 10, 2009 at 11:52 AM, Edward Song
>  wrote:
>> Hi all,
>>
>> This question concerns the Convention Plugin, specifically in regards to
>> Action Chaining.
>>
>> I am using Struts 2.1.6
>>
>> I have the following package structure.
>>
>>  com.company.web.actions.administrators.GetAction
>> (/administrators/get)
>>  com.company.web.actions.administrators.SaveAction
>> (/administrators/save)
>>
>> After SaveAction.execute(), I wanted to use action chaining and forward
>> to GetAction.execute().
>>
>> I was able to get this to work via annotations in my SaveAction class.  The
>> execute() method returns ActionSupport.SUCCESS.
>>
>> @Results({
>>
>> @Result(name=ActionSupport.*SUCCESS*, type="chain", location="get")
>>
>> })
>> However, it seems through the examples, that annotations may not be required
>> for simple action chaining.
>> Can we return an action name, effectively chainining the actions together?
>> I had attempted returning "get" in my SaveAction.execute(), thinking that it
>> would action chain GetAction.
>> The result was forwarded to my /WEB-INF/content/administrators/get.jsp, but
>> never actually ran GetAction.execute() .
>>
>> Any idea as to what my SaveAction.execute() method should return to
>> accomplish simple action chaining without the annotation above?
>>
>> Thank you in advance.
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



Re: Convention Plugin and Action Chaining

2009-03-10 Thread Musachy Barroso
Yes, you can chain actions if they are in the same package:

http://cwiki.apache.org/WW/convention-plugin.html#ConventionPlugin-Chaining

musachy

On Tue, Mar 10, 2009 at 11:52 AM, Edward Song
 wrote:
> Hi all,
>
> This question concerns the Convention Plugin, specifically in regards to
> Action Chaining.
>
> I am using Struts 2.1.6
>
> I have the following package structure.
>
>  com.company.web.actions.administrators.GetAction
> (/administrators/get)
>  com.company.web.actions.administrators.SaveAction
> (/administrators/save)
>
> After SaveAction.execute(), I wanted to use action chaining and forward
> to GetAction.execute().
>
> I was able to get this to work via annotations in my SaveAction class.  The
> execute() method returns ActionSupport.SUCCESS.
>
> @Results({
>
> @Result(name=ActionSupport.*SUCCESS*, type="chain", location="get")
>
> })
> However, it seems through the examples, that annotations may not be required
> for simple action chaining.
> Can we return an action name, effectively chainining the actions together?
> I had attempted returning "get" in my SaveAction.execute(), thinking that it
> would action chain GetAction.
> The result was forwarded to my /WEB-INF/content/administrators/get.jsp, but
> never actually ran GetAction.execute() .
>
> Any idea as to what my SaveAction.execute() method should return to
> accomplish simple action chaining without the annotation above?
>
> Thank you in advance.
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



Convention Plugin and Action Chaining

2009-03-10 Thread Edward Song
Hi all,

This question concerns the Convention Plugin, specifically in regards to
Action Chaining.

I am using Struts 2.1.6

I have the following package structure.

 com.company.web.actions.administrators.GetAction
(/administrators/get)
 com.company.web.actions.administrators.SaveAction
(/administrators/save)

After SaveAction.execute(), I wanted to use action chaining and forward
to GetAction.execute().

I was able to get this to work via annotations in my SaveAction class.  The
execute() method returns ActionSupport.SUCCESS.

@Results({

@Result(name=ActionSupport.*SUCCESS*, type="chain", location="get")

})
However, it seems through the examples, that annotations may not be required
for simple action chaining.
Can we return an action name, effectively chainining the actions together?
I had attempted returning "get" in my SaveAction.execute(), thinking that it
would action chain GetAction.
The result was forwarded to my /WEB-INF/content/administrators/get.jsp, but
never actually ran GetAction.execute() .

Any idea as to what my SaveAction.execute() method should return to
accomplish simple action chaining without the annotation above?

Thank you in advance.


Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-30 Thread Becky . L . O'Sullivan
I forgot to mention that we're setting the test value in struts.xml
initially (in the first action in the chain).  That's the value that
doesn't get modified in this test case.
-B



   
 Musachy Barroso   
  To 
   Struts Users Mailing List   
 01/29/2009 04:24  
 PM cc 
   
   Subject 
 Please respond to Re: [S2] possible bug in 2.1.6 w/   
   "Struts Users   action chaining 
   Mailing List"   
   
   
   
   




Nope I haven't, I started by looking at showcase and dropping your
classes there. I will give em a try if you don't see anything wrong in
showcase.

musachy

On Thu, Jan 29, 2009 at 6:15 PM,   wrote:
> Musachy,
>
> In the bug report, under Test 1 instructions it's shows it working
against
> 2.1.2  In the second set of instructions (accidentally also called Test
1)
> it details how to make it not work by swapping over to 2.1.6.
>
> Did you by any chance run this test case standalone, using the second set
> of instructions?
>
> -B
>
>
>
>
> Musachy Barroso
>  m> To
>   Struts Users Mailing List
> 01/29/2009 02:37  
> PM cc
>
>   Subject
>     Please respond to Re: [S2] possible bug in 2.1.6 w/
>   "Struts Users   action chaining
>   Mailing List"
>   he.org>
>
>
>
>
>
>
>
> Thanks for the testcase. I am looking at it, and there is a very
> similar case in showcase, but it seems fine.
>
> http://localhost:8080/struts2-showcase/actionchaining/actionChain1!input
>
> the output is:
>
> Action Chain 1 Property 1: Property Set In Action Chain 1
> Action Chain 2 Property 1: Property Set in Action Chain 2
> Action Chain 3 Property 1: Property set in Action Chain 3
>
> Do you see any difference from your testcase (which I haven't run yet)
>
> musachy
>
> On Thu, Jan 29, 2009 at 5:10 PM,  
wrote:
>> Thanks, bug WW-2970 was submitted along with a test case.
>> -B
>>
>>
>>
>>
>> Musachy Barroso
>> > m>
To
>>   Struts Users Mailing List
>> 01/28/2009 11:43  
>> AM
cc
>>
>>
Subject
>> Please respond to Re: [S2] possible bug in 2.1.6 w/
>>   "Struts Users   action chaining
>>   Mailing List"
>> >      he.org>
>>
>>
>>
>>
>>
>>
>>
>> This is the first report I hear, open a jira ticket and describe a
>> test case to replicate the problem.
>>
>> musachy
>>
>> On Wed, Jan 28, 2009 at 12:03 PM,  
>> wrote:
>>> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
>>> report.
>>> No one is using action chaining with 2.1.6?
>>>
>>> Thanks,
>>> -B
>>>
>>>
>>>
>>>
>>> Becky.L.O'Sulliva
>>> n...@healthnet.com
>>>
> To
>>> 01/27/2009 11:58  "Struts Users Mailing List"
>>> AM
>>>
> cc
>>>
>>> Please respond to
> Subject
>>>   "Struts Users   [S2] possible bug in 2.1.6 w/
>>>   Mailing List"   action chaining
>>> >>  he.org>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
&

Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-30 Thread Becky . L . O'Sullivan
Because Showcase is so packed with goodies something else may be causing
chaining to actually work.  If you try that test case standalone (after
modifying the POM XML for 2.1.6) chaining doesn't work (the value stays the
initial value).

-B



   
 Musachy Barroso   
  To 
   Struts Users Mailing List   
 01/29/2009 04:24  
 PM cc 
   
   Subject 
 Please respond to Re: [S2] possible bug in 2.1.6 w/   
   "Struts Users       action chaining 
   Mailing List"   
   
   
   
   




Nope I haven't, I started by looking at showcase and dropping your
classes there. I will give em a try if you don't see anything wrong in
showcase.

musachy

On Thu, Jan 29, 2009 at 6:15 PM,   wrote:
> Musachy,
>
> In the bug report, under Test 1 instructions it's shows it working
against
> 2.1.2  In the second set of instructions (accidentally also called Test
1)
> it details how to make it not work by swapping over to 2.1.6.
>
> Did you by any chance run this test case standalone, using the second set
> of instructions?
>
> -B
>
>
>
>
> Musachy Barroso
>  m> To
>   Struts Users Mailing List
> 01/29/2009 02:37  
> PM cc
>
>   Subject
> Please respond to Re: [S2] possible bug in 2.1.6 w/
>   "Struts Users   action chaining
>   Mailing List"
>   he.org>
>
>
>
>
>
>
>
> Thanks for the testcase. I am looking at it, and there is a very
> similar case in showcase, but it seems fine.
>
> http://localhost:8080/struts2-showcase/actionchaining/actionChain1!input
>
> the output is:
>
> Action Chain 1 Property 1: Property Set In Action Chain 1
> Action Chain 2 Property 1: Property Set in Action Chain 2
> Action Chain 3 Property 1: Property set in Action Chain 3
>
> Do you see any difference from your testcase (which I haven't run yet)
>
> musachy
>
> On Thu, Jan 29, 2009 at 5:10 PM,  
wrote:
>> Thanks, bug WW-2970 was submitted along with a test case.
>> -B
>>
>>
>>
>>
>> Musachy Barroso
>> > m>
To
>>       Struts Users Mailing List
>> 01/28/2009 11:43  
>> AM
cc
>>
>>
Subject
>> Please respond to Re: [S2] possible bug in 2.1.6 w/
>>   "Struts Users   action chaining
>>   Mailing List"
>> >  he.org>
>>
>>
>>
>>
>>
>>
>>
>> This is the first report I hear, open a jira ticket and describe a
>> test case to replicate the problem.
>>
>> musachy
>>
>> On Wed, Jan 28, 2009 at 12:03 PM,  
>> wrote:
>>> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
>>> report.
>>> No one is using action chaining with 2.1.6?
>>>
>>> Thanks,
>>> -B
>>>
>>>
>>>
>>>
>>> Becky.L.O'Sulliva
>>>     n...@healthnet.com
>>>
> To
>>> 01/27/2009 11:58  "Struts Users Mailing List"
>>> AM
>>>
> cc
>>>
>>> Please respond to
> Subject
>>>   "Struts Users   [S2] possible bug in 2.1.6 w/
>>>   Mailing List"   action chaining
>>> >>  he.org>
>>>
>>>
>>>
>>

Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-29 Thread Musachy Barroso
Nope I haven't, I started by looking at showcase and dropping your
classes there. I will give em a try if you don't see anything wrong in
showcase.

musachy

On Thu, Jan 29, 2009 at 6:15 PM,   wrote:
> Musachy,
>
> In the bug report, under Test 1 instructions it's shows it working against
> 2.1.2  In the second set of instructions (accidentally also called Test 1)
> it details how to make it not work by swapping over to 2.1.6.
>
> Did you by any chance run this test case standalone, using the second set
> of instructions?
>
> -B
>
>
>
>
> Musachy Barroso
>  m> To
>   Struts Users Mailing List
> 01/29/2009 02:37  
> PM cc
>
>   Subject
> Please respond to     Re: [S2] possible bug in 2.1.6 w/
>   "Struts Users   action chaining
>   Mailing List"
>   he.org>
>
>
>
>
>
>
>
> Thanks for the testcase. I am looking at it, and there is a very
> similar case in showcase, but it seems fine.
>
> http://localhost:8080/struts2-showcase/actionchaining/actionChain1!input
>
> the output is:
>
> Action Chain 1 Property 1: Property Set In Action Chain 1
> Action Chain 2 Property 1: Property Set in Action Chain 2
> Action Chain 3 Property 1: Property set in Action Chain 3
>
> Do you see any difference from your testcase (which I haven't run yet)
>
> musachy
>
> On Thu, Jan 29, 2009 at 5:10 PM,   wrote:
>> Thanks, bug WW-2970 was submitted along with a test case.
>> -B
>>
>>
>>
>>
>> Musachy Barroso
>> > m> To
>>   Struts Users Mailing List
>> 01/28/2009 11:43  
>> AM     cc
>>
>>   Subject
>> Please respond to Re: [S2] possible bug in 2.1.6 w/
>>   "Struts Users   action chaining
>>   Mailing List"
>> >  he.org>
>>
>>
>>
>>
>>
>>
>>
>> This is the first report I hear, open a jira ticket and describe a
>> test case to replicate the problem.
>>
>> musachy
>>
>> On Wed, Jan 28, 2009 at 12:03 PM,  
>> wrote:
>>> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
>>> report.
>>> No one is using action chaining with 2.1.6?
>>>
>>> Thanks,
>>> -B
>>>
>>>
>>>
>>>
>>> Becky.L.O'Sulliva
>>>     n...@healthnet.com
>>>
> To
>>> 01/27/2009 11:58  "Struts Users Mailing List"
>>> AM
>>>
> cc
>>>
>>> Please respond to
> Subject
>>>   "Struts Users   [S2] possible bug in 2.1.6 w/
>>>   Mailing List"   action chaining
>>> >>  he.org>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hi group,
>>>
>>> We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.
>>>
>>> We use action chaining because it suits a particular requirement we had
>> for
>>> this application.
>>> However, after upgrading, we're seeing that the value stack isn't
> holding
>>> on to values set by actions further up in the chain.   Has anyone tested
>>> 2.1.6 with the chain interceptor?
>>>
>>> Thanks,
>>> -Becky
>>>
>>>
>>>
>>> -
>>> This message, together with any attachments, is
>>> intended only for the use of the individual or entity
>>> to which it is addressed. It may contain information
>>> that is confidential and prohibited from disclosure.
>>> If you are not the intended recipient, you are hereby
>>> notified that any dissemination or copying of this
>>> message or any attachment is strictly prohibited. If
&

Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-29 Thread Becky . L . O'Sullivan
Musachy,

In the bug report, under Test 1 instructions it's shows it working against
2.1.2  In the second set of instructions (accidentally also called Test 1)
it details how to make it not work by swapping over to 2.1.6.

Did you by any chance run this test case standalone, using the second set
of instructions?

-B



   
 Musachy Barroso   
  To 
   Struts Users Mailing List   
 01/29/2009 02:37  
 PM cc 
   
   Subject 
 Please respond to Re: [S2] possible bug in 2.1.6 w/   
   "Struts Users       action chaining 
   Mailing List"   
   
   
   
   




Thanks for the testcase. I am looking at it, and there is a very
similar case in showcase, but it seems fine.

http://localhost:8080/struts2-showcase/actionchaining/actionChain1!input

the output is:

Action Chain 1 Property 1: Property Set In Action Chain 1
Action Chain 2 Property 1: Property Set in Action Chain 2
Action Chain 3 Property 1: Property set in Action Chain 3

Do you see any difference from your testcase (which I haven't run yet)

musachy

On Thu, Jan 29, 2009 at 5:10 PM,   wrote:
> Thanks, bug WW-2970 was submitted along with a test case.
> -B
>
>
>
>
> Musachy Barroso
>  m> To
>   Struts Users Mailing List
> 01/28/2009 11:43  
> AM cc
>
>   Subject
> Please respond to Re: [S2] possible bug in 2.1.6 w/
>   "Struts Users   action chaining
>   Mailing List"
>   he.org>
>
>
>
>
>
>
>
> This is the first report I hear, open a jira ticket and describe a
> test case to replicate the problem.
>
> musachy
>
> On Wed, Jan 28, 2009 at 12:03 PM,  
> wrote:
>> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
>> report.
>> No one is using action chaining with 2.1.6?
>>
>> Thanks,
>> -B
>>
>>
>>
>>
>> Becky.L.O'Sulliva
>> n...@healthnet.com
>>
To
>> 01/27/2009 11:58  "Struts Users Mailing List"
>> AM
>>
cc
>>
>> Please respond to
Subject
>>   "Struts Users   [S2] possible bug in 2.1.6 w/
>>   Mailing List"   action chaining
>> >  he.org>
>>
>>
>>
>>
>>
>>
>>
>>
>> Hi group,
>>
>> We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.
>>
>> We use action chaining because it suits a particular requirement we had
> for
>> this application.
>> However, after upgrading, we're seeing that the value stack isn't
holding
>> on to values set by actions further up in the chain.   Has anyone tested
>> 2.1.6 with the chain interceptor?
>>
>> Thanks,
>> -Becky
>>
>>
>>
>> -
>> This message, together with any attachments, is
>> intended only for the use of the individual or entity
>> to which it is addressed. It may contain information
>> that is confidential and prohibited from disclosure.
>> If you are not the intended recipient, you are hereby
>> notified that any dissemination or copying of this
>> message or any attachment is strictly prohibited. If
>> you have received this message in error, please notify
>> the original sender immediately by telephone or by
>> return e-mail and delete this message, along with any
>> attachments, from your computer. Thank you.
>>
>> ---

Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-29 Thread Becky . L . O'Sullivan
I'm guilty of pawning this task off to someone else.  I'll have him take a
look at showcase and our example and get back to the group.
Thanks for checking this out so quickly.  Maybe it's us.  :)
-B



   
 Musachy Barroso   
  To 
   Struts Users Mailing List   
 01/29/2009 02:49  
 PM cc 
   
   Subject 
 Please respond to Re: [S2] possible bug in 2.1.6 w/   
   "Struts Users   action chaining 
   Mailing List"   
   
   
   
   




I dropped your classes into showcase, and I am getting this:

Action1.execute()
Action1.execute() : getPageName() = null
Action1.execute() : getPageName() = PageNameFromAction1

Action2.execute()
Action2.execute() : getPageName() = PageNameFromAction1

which seems ok.
musachy

On Thu, Jan 29, 2009 at 5:37 PM, Musachy Barroso  wrote:
> Thanks for the testcase. I am looking at it, and there is a very
> similar case in showcase, but it seems fine.
>
> http://localhost:8080/struts2-showcase/actionchaining/actionChain1!input
>
> the output is:
>
> Action Chain 1 Property 1: Property Set In Action Chain 1
> Action Chain 2 Property 1: Property Set in Action Chain 2
> Action Chain 3 Property 1: Property set in Action Chain 3
>
> Do you see any difference from your testcase (which I haven't run yet)
>
> musachy
>
> On Thu, Jan 29, 2009 at 5:10 PM,  
wrote:
>> Thanks, bug WW-2970 was submitted along with a test case.
>> -B
>>
>>
>>
>>
>> Musachy Barroso
>> > m>
To
>>   Struts Users Mailing List
>> 01/28/2009 11:43  
>>     AM
cc
>>
>>
Subject
>> Please respond to Re: [S2] possible bug in 2.1.6 w/
>>   "Struts Users   action chaining
>>   Mailing List"
>> >  he.org>
>>
>>
>>
>>
>>
>>
>>
>> This is the first report I hear, open a jira ticket and describe a
>> test case to replicate the problem.
>>
>> musachy
>>
>> On Wed, Jan 28, 2009 at 12:03 PM,  
>> wrote:
>>> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
>>> report.
>>> No one is using action chaining with 2.1.6?
>>>
>>> Thanks,
>>> -B
>>>
>>>
>>>
>>>
>>> Becky.L.O'Sulliva
>>> n...@healthnet.com
>>>
To
>>> 01/27/2009 11:58  "Struts Users Mailing List"
>>> AM
>>>
cc
>>>
>>> Please respond to
Subject
>>>   "Struts Users   [S2] possible bug in 2.1.6 w/
>>>   Mailing List"   action chaining
>>> >>  he.org>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hi group,
>>>
>>> We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.
>>>
>>> We use action chaining because it suits a particular requirement we had
>> for
>>> this application.
>>> However, after upgrading, we're seeing that the value stack isn't
holding
>>> on to values set by actions further up in the chain.   Has anyone
tested
>>> 2.1.6 with the chain interceptor?
>>>
>>> Thanks,
>>> -Becky
>>>
>>>
>>>
>>> -
>>> This message, together with any attachments, is
>>> intended only for the use of the individual or entity
>>> to which it is addressed. It may contain information
>>> that is confidential and prohibited from disc

Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-29 Thread Musachy Barroso
I dropped your classes into showcase, and I am getting this:

Action1.execute()
Action1.execute() : getPageName() = null
Action1.execute() : getPageName() = PageNameFromAction1

Action2.execute()
Action2.execute() : getPageName() = PageNameFromAction1

which seems ok.
musachy

On Thu, Jan 29, 2009 at 5:37 PM, Musachy Barroso  wrote:
> Thanks for the testcase. I am looking at it, and there is a very
> similar case in showcase, but it seems fine.
>
> http://localhost:8080/struts2-showcase/actionchaining/actionChain1!input
>
> the output is:
>
> Action Chain 1 Property 1: Property Set In Action Chain 1
> Action Chain 2 Property 1: Property Set in Action Chain 2
> Action Chain 3 Property 1: Property set in Action Chain 3
>
> Do you see any difference from your testcase (which I haven't run yet)
>
> musachy
>
> On Thu, Jan 29, 2009 at 5:10 PM,   wrote:
>> Thanks, bug WW-2970 was submitted along with a test case.
>> -B
>>
>>
>>
>>
>> Musachy Barroso
>> > m> To
>>   Struts Users Mailing List
>> 01/28/2009 11:43  
>> AM cc
>>
>>       Subject
>> Please respond to Re: [S2] possible bug in 2.1.6 w/
>>   "Struts Users   action chaining
>>   Mailing List"
>> >  he.org>
>>
>>
>>
>>
>>
>>
>>
>> This is the first report I hear, open a jira ticket and describe a
>> test case to replicate the problem.
>>
>> musachy
>>
>> On Wed, Jan 28, 2009 at 12:03 PM,  
>> wrote:
>>> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
>>> report.
>>> No one is using action chaining with 2.1.6?
>>>
>>> Thanks,
>>> -B
>>>
>>>
>>>
>>>
>>> Becky.L.O'Sulliva
>>> n...@healthnet.com
>>>    To
>>> 01/27/2009 11:58  "Struts Users Mailing List"
>>> AM
>>>    cc
>>>
>>> Please respond to Subject
>>>   "Struts Users   [S2] possible bug in 2.1.6 w/
>>>   Mailing List"   action chaining
>>> >>  he.org>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hi group,
>>>
>>> We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.
>>>
>>> We use action chaining because it suits a particular requirement we had
>> for
>>> this application.
>>> However, after upgrading, we're seeing that the value stack isn't holding
>>> on to values set by actions further up in the chain.   Has anyone tested
>>> 2.1.6 with the chain interceptor?
>>>
>>> Thanks,
>>> -Becky
>>>
>>>
>>>
>>> -
>>> This message, together with any attachments, is
>>> intended only for the use of the individual or entity
>>> to which it is addressed. It may contain information
>>> that is confidential and prohibited from disclosure.
>>> If you are not the intended recipient, you are hereby
>>> notified that any dissemination or copying of this
>>> message or any attachment is strictly prohibited. If
>>> you have received this message in error, please notify
>>> the original sender immediately by telephone or by
>>> return e-mail and delete this message, along with any
>>> attachments, from your computer. Thank you.
>>>
>>> -
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>>
>>>
>>>
>>> -
>>> This message, toget

Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-29 Thread Musachy Barroso
Thanks for the testcase. I am looking at it, and there is a very
similar case in showcase, but it seems fine.

http://localhost:8080/struts2-showcase/actionchaining/actionChain1!input

the output is:

Action Chain 1 Property 1: Property Set In Action Chain 1
Action Chain 2 Property 1: Property Set in Action Chain 2
Action Chain 3 Property 1: Property set in Action Chain 3

Do you see any difference from your testcase (which I haven't run yet)

musachy

On Thu, Jan 29, 2009 at 5:10 PM,   wrote:
> Thanks, bug WW-2970 was submitted along with a test case.
> -B
>
>
>
>
> Musachy Barroso
>  m> To
>   Struts Users Mailing List
> 01/28/2009 11:43  
> AM cc
>
>   Subject
> Please respond to Re: [S2] possible bug in 2.1.6 w/
>   "Struts Users   action chaining
>   Mailing List"
>   he.org>
>
>
>
>
>
>
>
> This is the first report I hear, open a jira ticket and describe a
> test case to replicate the problem.
>
> musachy
>
> On Wed, Jan 28, 2009 at 12:03 PM,  
> wrote:
>> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
>> report.
>> No one is using action chaining with 2.1.6?
>>
>> Thanks,
>> -B
>>
>>
>>
>>
>> Becky.L.O'Sulliva
>> n...@healthnet.com
>>To
>> 01/27/2009 11:58  "Struts Users Mailing List"
>> AM
>>    cc
>>
>> Please respond to Subject
>>   "Struts Users   [S2] possible bug in 2.1.6 w/
>>   Mailing List"   action chaining
>> >  he.org>
>>
>>
>>
>>
>>
>>
>>
>>
>> Hi group,
>>
>> We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.
>>
>> We use action chaining because it suits a particular requirement we had
> for
>> this application.
>> However, after upgrading, we're seeing that the value stack isn't holding
>> on to values set by actions further up in the chain.   Has anyone tested
>> 2.1.6 with the chain interceptor?
>>
>> Thanks,
>> -Becky
>>
>>
>>
>> -
>> This message, together with any attachments, is
>> intended only for the use of the individual or entity
>> to which it is addressed. It may contain information
>> that is confidential and prohibited from disclosure.
>> If you are not the intended recipient, you are hereby
>> notified that any dissemination or copying of this
>> message or any attachment is strictly prohibited. If
>> you have received this message in error, please notify
>> the original sender immediately by telephone or by
>> return e-mail and delete this message, along with any
>> attachments, from your computer. Thank you.
>>
>> -
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>>
>>
>> -
>> This message, together with any attachments, is
>> intended only for the use of the individual or entity
>> to which it is addressed. It may contain information
>> that is confidential and prohibited from disclosure.
>> If you are not the intended recipient, you are hereby
>> notified that any dissemination or copying of this
>> message or any attachment is strictly prohibited. If
>> you have received this message in error, please notify
>> the original sender immediately by telephone or by
>> return e-mail and delete this message, along with any
>> attachments, from your computer. Thank you.
>>
>> -
>>
>> -
&

Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-29 Thread Becky . L . O'Sullivan
Thanks, bug WW-2970 was submitted along with a test case.
-B



   
 Musachy Barroso   
  To 
   Struts Users Mailing List   
 01/28/2009 11:43  
 AM cc 
   
   Subject 
 Please respond to Re: [S2] possible bug in 2.1.6 w/   
   "Struts Users   action chaining 
   Mailing List"   
   
   
   
   




This is the first report I hear, open a jira ticket and describe a
test case to replicate the problem.

musachy

On Wed, Jan 28, 2009 at 12:03 PM,  
wrote:
> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
> report.
> No one is using action chaining with 2.1.6?
>
> Thanks,
> -B
>
>
>
>
> Becky.L.O'Sulliva
> n...@healthnet.com
>To
> 01/27/2009 11:58  "Struts Users Mailing List"
> AM
>cc
>
> Please respond to Subject
>   "Struts Users   [S2] possible bug in 2.1.6 w/
>   Mailing List"   action chaining
>   he.org>
>
>
>
>
>
>
>
>
> Hi group,
>
> We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.
>
> We use action chaining because it suits a particular requirement we had
for
> this application.
> However, after upgrading, we're seeing that the value stack isn't holding
> on to values set by actions further up in the chain.   Has anyone tested
> 2.1.6 with the chain interceptor?
>
> Thanks,
> -Becky
>
>
>
> -
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
>
> -
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
>
>
> -
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
>
> -
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



--
"Hey you! Would you help me to carry the stone?" Pink Floyd

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






Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-28 Thread Musachy Barroso
This is the first report I hear, open a jira ticket and describe a
test case to replicate the problem.

musachy

On Wed, Jan 28, 2009 at 12:03 PM,   wrote:
> Hadn't heard back from anyone about this.  I'll go ahead and file a bug
> report.
> No one is using action chaining with 2.1.6?
>
> Thanks,
> -B
>
>
>
>
> Becky.L.O'Sulliva
> n...@healthnet.com
>To
> 01/27/2009 11:58  "Struts Users Mailing List"
> AM
>cc
>
> Please respond to Subject
>   "Struts Users   [S2] possible bug in 2.1.6 w/
>   Mailing List"   action chaining
>   he.org>
>
>
>
>
>
>
>
>
> Hi group,
>
> We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.
>
> We use action chaining because it suits a particular requirement we had for
> this application.
> However, after upgrading, we're seeing that the value stack isn't holding
> on to values set by actions further up in the chain.   Has anyone tested
> 2.1.6 with the chain interceptor?
>
> Thanks,
> -Becky
>
>
>
> -
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
>
> -
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
>
>
> -
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
>
> -
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



Re: [S2] possible bug in 2.1.6 w/ action chaining

2009-01-28 Thread Becky . L . O'Sullivan
Hadn't heard back from anyone about this.  I'll go ahead and file a bug
report.
No one is using action chaining with 2.1.6?

Thanks,
-B



   
 Becky.L.O'Sulliva 
 n...@healthnet.com   
To 
 01/27/2009 11:58  "Struts Users Mailing List" 
 AM
cc 
   
 Please respond to Subject 
   "Struts Users   [S2] possible bug in 2.1.6 w/   
   Mailing List"   action chaining 
   
   
   
   
   




Hi group,

We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.

We use action chaining because it suits a particular requirement we had for
this application.
However, after upgrading, we're seeing that the value stack isn't holding
on to values set by actions further up in the chain.   Has anyone tested
2.1.6 with the chain interceptor?

Thanks,
-Becky



-
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

-

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





-
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

-

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



[S2] possible bug in 2.1.6 w/ action chaining

2009-01-27 Thread Becky . L . O'Sullivan
Hi group,

We're trying to upgrade from 2.1.2 to 2.1.6 and ran into an issue.

We use action chaining because it suits a particular requirement we had for
this application.
However, after upgrading, we're seeing that the value stack isn't holding
on to values set by actions further up in the chain.   Has anyone tested
2.1.6 with the chain interceptor?

Thanks,
-Becky



-
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

-

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



RE: [S2] solution - Action chaining and validation problem

2008-09-18 Thread Becky . L . O'Sullivan
The culprit wasn't the validation interceptor, but the workflow
interceptor.  Its only job is to stop the chain (and call input on
everything) when validation errors occur.  I removed it entirely and
everything is working as we need it to.  This worked for us because,
regardless of errors, we need our entire chain to go to completion.

I could have used the excludeMethods parameter, but it would have been * .
(so it was better to remove it entirely)

Thanks for the help,
-B



   
 Martin Gainty 
 <[EMAIL PROTECTED] 
 com>   To 
   Struts Users Mailing List   
 09/17/2008 03:55  
 PM cc 
   
   Subject 
 Please respond to     RE: [S2] Action chaining and
   "Struts Users   validation problem  
   Mailing List"   
 <[EMAIL PROTECTED] 
  he.org>  
   
   
   





1 down ..more to go..have you have declared any methods in excludeMethods
 ?

http://struts.apache.org/2.0.6
/struts2-core/apidocs/com/opensymphony/xwork2/validator/ValidationInterceptor.html


Martin
__
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission.


> Subject: RE: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'[EMAIL PROTECTED]
> Date: Wed, 17 Sep 2008 15:32:49 -0700
>
> We actually have no validation XML files (we're setting error fields
> manually).  We're not performing validation using that approach, but we
> want to remain open to doing so in the future.   The validation
interceptor
> is in the struts-default stack, which is what our packages extend from.
>
> From what Dave said it sounds like short circuiting is not our solution.
> Is there perhaps a setting we're missing on the chaining interceptor to
> tell it not to call validation/input on downstream chained actions?
>
> I read a similar thread where someone suggested reordering the
interceptor
> stack so that validation is above chain, because when chain is first it
> copies action errors into the next action in the chain.  I've started
> making a custom interceptor stack to try this, but my guess is the action
> that JSP result won't see the action errors from the one action that
*does*
> set action error messages because they won't get copied down the stack.
>
> It seems like the framework is calling input on any downstream chained
> action if action errors are placed on the value stack by an upstream
> chained action.  We even have some actions called via s:action (execute
> results = true) in the JSP result and it's trying to call input even on
> those actions.
>
> -B
>
>
>
>
>

>  Martin Gainty

>  <[EMAIL PROTECTED]

>  com>
To
>        Struts Users Mailing List

>  09/17/2008 11:21  

>  AM
cc
>

>
Subject
>  Please respond to RE: [S2] Action chaining and

>"Struts Users   validation problem

>Mailing List"

>  <[EMAIL PROTECTED]

>   he.org>

>

>

>

>
>
>
>
>
> check  your validators.xml to see if your short-circuit attribute is set
to
> true
> The invokemethod grants the Interceptor the power to short-circuiting the
> Action Invocation.
> Instead of calling invoke, the Interceptor can
> return a result String and
> bypass any remaining Interceptors on the stack and the Action's execute
> method.
> e.g.
>  
>
>
>
> you'll want to set

RE: [S2] Action chaining and validation problem

2008-09-17 Thread Becky . L . O'Sullivan
I'm referencing defaultStack.  Can I simply pass that parameter to the
default stack and the validator interceptor will pick it up?
We don't actually use xml-based validation.  We set action errors on our
own.  Do you think it'll still work even though that interceptor is
specifically for xml based validation?

Is there no setting on the chain interceptor to proceed "business as usual"
through all downstream action methods if one encounters an error?

Thanks,
-B






   
 Martin Gainty 
 <[EMAIL PROTECTED] 
 com>   To 
   Struts Users Mailing List   
 09/17/2008 03:55  
 PM cc 
   
   Subject 
 Please respond to     RE: [S2] Action chaining and
   "Struts Users   validation problem  
   Mailing List"   
 <[EMAIL PROTECTED] 
  he.org>  
   
   
   





1 down ..more to go..have you have declared any methods in excludeMethods
 ?

http://struts.apache.org/2.0.6
/struts2-core/apidocs/com/opensymphony/xwork2/validator/ValidationInterceptor.html


Martin
__
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission.


> Subject: RE: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'[EMAIL PROTECTED]
> Date: Wed, 17 Sep 2008 15:32:49 -0700
>
> We actually have no validation XML files (we're setting error fields
> manually).  We're not performing validation using that approach, but we
> want to remain open to doing so in the future.   The validation
interceptor
> is in the struts-default stack, which is what our packages extend from.
>
> From what Dave said it sounds like short circuiting is not our solution.
> Is there perhaps a setting we're missing on the chaining interceptor to
> tell it not to call validation/input on downstream chained actions?
>
> I read a similar thread where someone suggested reordering the
interceptor
> stack so that validation is above chain, because when chain is first it
> copies action errors into the next action in the chain.  I've started
> making a custom interceptor stack to try this, but my guess is the action
> that JSP result won't see the action errors from the one action that
*does*
> set action error messages because they won't get copied down the stack.
>
> It seems like the framework is calling input on any downstream chained
> action if action errors are placed on the value stack by an upstream
> chained action.  We even have some actions called via s:action (execute
> results = true) in the JSP result and it's trying to call input even on
> those actions.
>
> -B
>
>
>
>
>

>  Martin Gainty

>  <[EMAIL PROTECTED]

>  com>
To
>    Struts Users Mailing List

>  09/17/2008 11:21  

>  AM
cc
>

>
Subject
>  Please respond to RE: [S2] Action chaining and

>"Struts Users   validation problem

>Mailing List"

>  <[EMAIL PROTECTED]

>   he.org>

>

>

>

>
>
>
>
>
> check  your validators.xml to see if your short-circuit attribute is set
to
> true
> The invokemethod grants the Interceptor the power to short-circuiting the
> Action Invocation.
> Instead of calling invoke, the Interceptor can
> return a result String and
> bypass any remaining Interceptors on the stack and the Action's execute
> method.
> e.g.
>  
>
>
>
> you'll 

RE: [S2] Action chaining and validation problem

2008-09-17 Thread Martin Gainty

1 down ..more to go..have you have declared any methods in excludeMethods
 ?

http://struts.apache.org/2.0.6/struts2-core/apidocs/com/opensymphony/xwork2/validator/ValidationInterceptor.html

Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


> Subject: RE: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'[EMAIL PROTECTED]
> Date: Wed, 17 Sep 2008 15:32:49 -0700
> 
> We actually have no validation XML files (we're setting error fields
> manually).  We're not performing validation using that approach, but we
> want to remain open to doing so in the future.   The validation interceptor
> is in the struts-default stack, which is what our packages extend from.
> 
> From what Dave said it sounds like short circuiting is not our solution.
> Is there perhaps a setting we're missing on the chaining interceptor to
> tell it not to call validation/input on downstream chained actions?
> 
> I read a similar thread where someone suggested reordering the interceptor
> stack so that validation is above chain, because when chain is first it
> copies action errors into the next action in the chain.  I've started
> making a custom interceptor stack to try this, but my guess is the action
> that JSP result won't see the action errors from the one action that *does*
> set action error messages because they won't get copied down the stack.
> 
> It seems like the framework is calling input on any downstream chained
> action if action errors are placed on the value stack by an upstream
> chained action.  We even have some actions called via s:action (execute
> results = true) in the JSP result and it's trying to call input even on
> those actions.
> 
> -B
> 
> 
> 
> 
>
>  Martin Gainty 
>  <[EMAIL PROTECTED] 
>  com>   To 
>Struts Users Mailing List   
>  09/17/2008 11:21  
>  AM cc 
>        
>Subject 
>  Please respond to RE: [S2] Action chaining and
>"Struts Users   validation problem  
>Mailing List"   
>  <[EMAIL PROTECTED] 
>   he.org>  
>
>
>
> 
> 
> 
> 
> 
> check  your validators.xml to see if your short-circuit attribute is set to
> true
> The invokemethod grants the Interceptor the power to short-circuiting the
> Action Invocation.
> Instead of calling invoke, the Interceptor can
> return a result String and
> bypass any remaining Interceptors on the stack and the Action's execute
> method.
> e.g.
>  
>
>
>
> you'll want to set short-circuit="false" to allow interceptors and execute
> to be invoked
> 
> http://struts.apache.org/2.x/docs/understanding-interceptors.html
> 
> Martin
> __
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission.
> 
> 
> > Subject: [S2] Action chaining and validation problem
> > To: user@struts.apache.org
> > From: Becky.L.O'[EMAIL PROTECTED]
> > Date: Wed, 17 Sep 2008 10:30:06 -0700
> >
> >
> > Without going into a lot of detail, suffice to say our application
> benefits
> > from action

RE: [S2] Action chaining and validation problem

2008-09-17 Thread Becky . L . O'Sullivan
We actually have no validation XML files (we're setting error fields
manually).  We're not performing validation using that approach, but we
want to remain open to doing so in the future.   The validation interceptor
is in the struts-default stack, which is what our packages extend from.

From what Dave said it sounds like short circuiting is not our solution.
Is there perhaps a setting we're missing on the chaining interceptor to
tell it not to call validation/input on downstream chained actions?

I read a similar thread where someone suggested reordering the interceptor
stack so that validation is above chain, because when chain is first it
copies action errors into the next action in the chain.  I've started
making a custom interceptor stack to try this, but my guess is the action
that JSP result won't see the action errors from the one action that *does*
set action error messages because they won't get copied down the stack.

It seems like the framework is calling input on any downstream chained
action if action errors are placed on the value stack by an upstream
chained action.  We even have some actions called via s:action (execute
results = true) in the JSP result and it's trying to call input even on
those actions.

-B




   
 Martin Gainty 
 <[EMAIL PROTECTED] 
 com>   To 
   Struts Users Mailing List   
 09/17/2008 11:21  
 AM cc 
   
   Subject 
     Please respond to RE: [S2] Action chaining and
   "Struts Users   validation problem  
   Mailing List"   
 <[EMAIL PROTECTED] 
  he.org>  
   
   
   





check  your validators.xml to see if your short-circuit attribute is set to
true
The invokemethod grants the Interceptor the power to short-circuiting the
Action Invocation.
Instead of calling invoke, the Interceptor can
return a result String and
bypass any remaining Interceptors on the stack and the Action's execute
method.
e.g.
 
   
   
   
you'll want to set short-circuit="false" to allow interceptors and execute
to be invoked

http://struts.apache.org/2.x/docs/understanding-interceptors.html

Martin
__
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission.


> Subject: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'[EMAIL PROTECTED]
> Date: Wed, 17 Sep 2008 10:30:06 -0700
>
>
> Without going into a lot of detail, suffice to say our application
benefits
> from action chaning, and we are using it in the documented way.
>
> We've begun to go through and add the validation to some actions, but we
> have run into a snag with validation and action chaining.
>
> Whenever one action in the chain encounters an error as a result of
> validation all other actions are affected.  Struts then calls the input
> method on all downstream actions.  However, some actions don't override
> input, and by calling only the input method on those actions Struts is
not
> calling the intended method (be it execute() or a named method), and
those
> actions are not executing properly.  Not only are downstream actions
> affected, but simple actions called using the  affected in the same way.
>
> It seems like, whenever there are action errors in the value stack,
> everything passed that value stack gets a call to input.
>
> Has anyone else run in to this kind of issue with action chaining and
> validation?
>
> Thanks,
> -B
>
>
>
> -
> This message, together with any attachments, is
> intended only for the use of the individual o

RE: [S2] Action chaining and validation problem

2008-09-17 Thread Dave Newton
--- On Wed, 9/17/08, Martin Gainty wrote:
> check  your validators.xml to see if your short-circuit
> attribute is set to true

My understanding is that validation short-circuiting means that additional 
validations for the same field won't be run as soon as the first validation 
error is encountered (plus rules for plain vs. field validators).

See 
http://struts.apache.org/2.x/docs/validation.html#Validation-ShortCircuitingValidator

This won't affect the invocation chain at all. I'd be interesting in clarifying 
this--where is the documentation that supports what you're saying?

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [S2] Action chaining and validation problem

2008-09-17 Thread Martin Gainty

check  your validators.xml to see if your short-circuit attribute is set to true
The invokemethod grants the Interceptor the power to short-circuiting the 
Action Invocation. 
Instead of calling invoke, the Interceptor can 
return a result String and 
bypass any remaining Interceptors on the stack and the Action's execute method.
e.g.
 
   
   
   
you'll want to set short-circuit="false" to allow interceptors and execute to 
be invoked

http://struts.apache.org/2.x/docs/understanding-interceptors.html

Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


> Subject: [S2] Action chaining and validation problem
> To: user@struts.apache.org
> From: Becky.L.O'[EMAIL PROTECTED]
> Date: Wed, 17 Sep 2008 10:30:06 -0700
> 
> 
> Without going into a lot of detail, suffice to say our application benefits
> from action chaning, and we are using it in the documented way.
> 
> We've begun to go through and add the validation to some actions, but we
> have run into a snag with validation and action chaining.
> 
> Whenever one action in the chain encounters an error as a result of
> validation all other actions are affected.  Struts then calls the input
> method on all downstream actions.  However, some actions don't override
> input, and by calling only the input method on those actions Struts is not
> calling the intended method (be it execute() or a named method), and those
> actions are not executing properly.  Not only are downstream actions
> affected, but simple actions called using the  affected in the same way.
> 
> It seems like, whenever there are action errors in the value stack,
> everything passed that value stack gets a call to input.
> 
> Has anyone else run in to this kind of issue with action chaining and
> validation?
> 
> Thanks,
> -B
> 
> 
> 
> -
> This message, together with any attachments, is
> intended only for the use of the individual or entity
> to which it is addressed. It may contain information
> that is confidential and prohibited from disclosure.
> If you are not the intended recipient, you are hereby
> notified that any dissemination or copying of this
> message or any attachment is strictly prohibited. If
> you have received this message in error, please notify
> the original sender immediately by telephone or by
> return e-mail and delete this message, along with any
> attachments, from your computer. Thank you.
> 
> -
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

[S2] Action chaining and validation problem

2008-09-17 Thread Becky . L . O'Sullivan

Without going into a lot of detail, suffice to say our application benefits
from action chaning, and we are using it in the documented way.

We've begun to go through and add the validation to some actions, but we
have run into a snag with validation and action chaining.

Whenever one action in the chain encounters an error as a result of
validation all other actions are affected.  Struts then calls the input
method on all downstream actions.  However, some actions don't override
input, and by calling only the input method on those actions Struts is not
calling the intended method (be it execute() or a named method), and those
actions are not executing properly.  Not only are downstream actions
affected, but simple actions called using the 

Re: Questions on action chaining and validation in struts2 - please help

2008-06-18 Thread wild_oscar

More than one year later, I have the exact same problem.

If the original poster has found a solution, or if anyone else knows how to
solve this issue, I'd be very glad!

I have tried Action Chaining the result:
@Result(name="input",type=ActionChainResult.class,value="product" ,params=
{"method","getOne"}),

However, Struts will try to find the "input" result of the chained action
(product), and will never reach the method.


aj123 wrote:
> 
> Hi
> I am trying to use action chaining in struts2 and am stuck. Any help would
> be really appreciated.
> 
> Scenario - I have a page that shows a list of records and also has a form
> to add a new record. When user clicks on add I call addAction and chain it
> to list action to go back to list page again showing the newly added
> record.
> 
> My struts.xml looks something like this ->
> 
> 
>
>list
>
>list
> 
> 
>/proj/list.jsp
> 
> 
> I have 2 issues/questions - 
> a) My validation does not work if I chain actions. If I don't enter
> anything in add textbox and click on Add then I get a html 404 error. If I
> route to list.jsp instead of chaning to list action then I see validation
> messages. But I really need to show list on that page as well. So I can
> not forward to the jsp.
> 
> b) When I chain 2 actions, can I pass new params for second action? It
> does not seem to work for me e.g. In following example, I can not pass foo
> param to list action that is chained to add action.
> 
> 
> 
> list
> bar
> 
> list
> 
> 
> I would really appreciate some feedback/help here.
> 

-- 
View this message in context: 
http://www.nabble.com/Questions-on-action-chaining-and-validation-in-struts2---please-help-tp10036082p17980459.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2: Action chaining behaving differently when validations fire

2008-05-06 Thread Paweł Badeński
I just came up with another idea. You could also try to move
validation up the stack, so it's happening before chain.. It might be
tricky tough (as Struts spec states: "Sometimes the order of the
Interceptors makes a difference.").

best regards
Pawel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2: Action chaining behaving differently when validations fire

2008-05-06 Thread Paweł Badeński
2008/5/5 egetchell <[EMAIL PROTECTED]>:
>
>  I just re-read my post and noticed that the Struts configuration for the
>  testB action somehow got mangled.  The correct configuration for TestB is
>
>
>  
>   
> testA
> display
>   
>  

I'd suspect that validation errors are being chained to another
action, so after the flow has been forwarded to testA it never reaches
the "display" method. I'm not sure if you can get around it other
(easy) way than removing validation interceptors from testA.

best regards,
Pawel

-- 
Paweł Badeński
Student MS Software Engineering
Wroclaw University of Technology
Wrocław, Poland


Re: Struts 2: Action chaining behaving differently when validations fire

2008-05-05 Thread egetchell

I just re-read my post and noticed that the Struts configuration for the
testB action somehow got mangled.  The correct configuration for TestB is


  
testA
display
  

-- 
View this message in context: 
http://www.nabble.com/Struts-2%3A-Action-chaining-behaving-differently-when-validations-fire-tp17065631p17070480.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2: Action chaining behaving differently when validations fire

2008-05-05 Thread egetchell

All,

I’m experiencing some interesting behavior when forwarding via action
chaining as a result of input validation.

In a non-error situation, action chaining works as expected – that is the
service method of the chained action is invoked as expected.  However, what
I am noticing is that when a validation error fires, the service method of
the chained action is bypassed entirely – instead the request is forwarded
to the result defined in the struts mapping of the action class.

To test this, I created two simple classes, testA and testB.  testA is used
to build the data to display a page and testB is used to collect the data
from the page.   

The Struts configuration is the following (Spring is being used as the
object factory):


  testA.jsp



  
testA
display
  


The display method of testA always returns INPUT.
The submit method of B always returns INPUT.

This allows me to test the same result of INPUT – one invoked via an input
validation error and the second during normal application flow.

When testB is invoked and no validation errors fire (INPUT is returned from
the service method), I see the following methods invoked on the back-end:
TestB.submit
TestA.display

However, when testB is invoked and validation errors fire, TestA.display is
not invoked.  Instead, the input mapping is read and the request is
forwarded to testA.jsp per the mapping.

Ideally, I’d like the testA action to fire when validation fires.

Eric Getchell | Sr. Technologist

Distributed Logic Corporation
600 Unicorn Park
Woburn, MA 01801


-- 
View this message in context: 
http://www.nabble.com/Struts-2%3A-Action-chaining-behaving-differently-when-validations-fire-tp17065631p17065631.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Action chaining problem

2008-03-27 Thread Enrico Drusiani

hi

i've a problem with action chaining. i've defined a xml action in a xml 
file called struts-ordini.xml with the following result


ResiSelection

the target action is in another xml file that is imported before the 
"struts-ordini.xml".
i can't understand why the chaining fails, reloading the page as per 
"success" without even giving any error.


thanks for your time and help






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Fwd: Re: Having query on action chaining

2007-11-21 Thread Dave Newton
--- vijay vijay <[EMAIL PROTECTED]> wrote:
> i have seen the page from here  ""
> struts-2.0.11\docs\docs\action-chaining.html"".
> there i could not get much
> info.i am looking more.if u have info with u u can
> help me.any sample
> examples and any working examples are also welcome

I still don't know what additional information you
want. You have an action, one of its results is
type="chain" and it goes to another action.

Have you tried it to see if it does what you want it
to? There isn't much more to add than what's already
on that page.

d.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Having query on action chaining

2007-11-21 Thread vijay vijay
hi *Alexis ,*
*i am looking action chaining in struts 2, i have gone
through the page which is there in docs and observing the showcase also. but
i wanted to be more specific to this point even interseptors can you help
me?? *

**




On 11/21/07, Alexis Pigeon <[EMAIL PROTECTED]> wrote:
>
> Hi vijay,
>
> On 21/11/2007, vijay vijay <[EMAIL PROTECTED]> wrote:
> > thank you,
> > i have seen this iam looking for more
> links...
>
> http://www.google.com/search?hl=en&q=struts+action+chaining
>
> I don't mean to be rude, but that's the best we can offer if you are
> not more specific about what you are looking for...
>
> cheers,
> alexis
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Having query on action chaining

2007-11-21 Thread Alexis Pigeon
Hi vijay,

On 21/11/2007, vijay vijay <[EMAIL PROTECTED]> wrote:
> thank you,
> i have seen this iam looking for more links...

http://www.google.com/search?hl=en&q=struts+action+chaining

I don't mean to be rude, but that's the best we can offer if you are
not more specific about what you are looking for...

cheers,
alexis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Having query on action chaining

2007-11-21 Thread vijay vijay
thank you,
i have seen this iam looking for more links...

vijay


On 11/21/07, Omkar Patil <[EMAIL PROTECTED]> wrote:
>
>
> http://struts.apache.org/2.0.11/docs/action-chaining.html
>
>
> vijay vijay wrote:
> >
> > Hi,
> >  i am want to work on action chaining can any one give me links
> > for
> > it.
> >
> > vijay
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Having-query-on-action-chaining-tf4847957.html#a13873158
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Having query on action chaining

2007-11-21 Thread Omkar Patil

http://struts.apache.org/2.0.11/docs/action-chaining.html


vijay vijay wrote:
> 
> Hi,
>  i am want to work on action chaining can any one give me links
> for
> it.
> 
> vijay
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Having-query-on-action-chaining-tf4847957.html#a13873158
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Having query on action chaining

2007-11-20 Thread vijay vijay
Hi,
 i am want to work on action chaining can any one give me links for
it.

vijay


Re: Manually obtain previous action parameters after action "chaining"?

2007-11-08 Thread jjgould

There was a good suggestion about using the MessageStoreInterceptor, but I am
really trying to avoid using Session-based storage for my application,
having been indoctrinated into the RESTful camp at the 2007 Colorado
Software Summit :)

I just discovered that both actions (the one that gets the validation errors
and the target of the chain result) are on the OGNL stack.  So, here is what
I did:



> @Override
> public String execute()
> throws Exception
> {
> ValueStack stack = ActionContext.getContext().getValueStack();
> Object penultimate = stack.findValue( "[1].top" );
> if( penultimate instanceof ValidationAware )
> {
> ValidationAware previousAction = (ValidationAware)
> penultimate;
> this.setActionErrors( previousAction.getActionErrors() );
> this.setActionMessages( previousAction.getActionMessages() );
> this.setFieldErrors( previousAction.getFieldErrors() );
> }
> return SUCCESS;
> }
> 

I like this approach because it seems clean.  But, I am wondering, given the
fact that bean properties are set in the second action, why aren't
"actionErrors", "actionMessages", and "fieldErrors" seen as bean properties
that get automatically set by the ChainingInterceptor?

Anyway, this solution is working for me, and I think I should abstract this
out into an interceptor so that I don't have to pollute my action methods
with this logic.  Does anyone have any feedback about this approach?  Am I
abusing the OGNL stack?  Am I breaking semantics of validation handling?  Is
it possible that the first action will not be located on the stack as
"[1].top"?

Thanks for your help!


jjgould wrote:
> 
> Ted, et. al.,
> 
> I am also interested in accessing the previous action from the target
> action of a "chain" result.  But, the reason I want to get to that action
> is not because of any bean properties, but because I need the action
> errors, action messages, and field errors that may have been placed there
> by my validation.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13647964
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manually obtain previous action parameters after action "chaining"?

2007-11-07 Thread Gary Affonso
You can preserve errors and messages from one action to another, across 
a redirect, with the MessageStoreInterceptor.  See here:


  http://struts.apache.org/2.x/docs/message-store-interceptor.html

This lets you avoid chaining which, of course, is usually evil. :-)

- Gary

jjgould wrote:

Ted, et. al.,

I am also interested in accessing the previous action from the target action
of a "chain" result.  But, the reason I want to get to that action is not
because of any bean properties, but because I need the action errors, action
messages, and field errors that may have been placed there by my validation.

In my case, action "one" is used to view an object that is an aggregate of a
lot of smaller objects.  Action "two" is used to add a new component object
to the collection.  However, when there is a validation error on the new
object, the application needs to forward back to action "one" to redisplay
the object and it needs to have the field error messages.  The struts.xml
looks like this:


{1}
/WEB-INF/jsp/case/viewCase.jsp



{1}

{1}/view


{1}/view



Any tips you can offer are greatly appreciated.

- Jack Gould
  Sherwin-Williams
  Cleveland, Ohio, USA


Ted Husted wrote:

Binding two Action classes together that way sounds like a "slippery
slope" to me. It seems like a better practice to rely on standard
JavaBean semantics, and access the values that need to be brought
forward through the usual get and set methods.

One other thing to try, which you may have started to do, would be to
save the object as a request attribute, as an alternative to the chain
result. In this case, both Actions would have setRequest and
getRequest methods.

ActionOne
 getRequest().put("searchParameter",getSearchParameter());

ActionTwo
 setSearchParameter( (SearchParameter) getRequest().get("searchParameter")
);

The JVM is optimized for property methods, and overall it's a better
practice to go through the getters and setters than access fields
directly.

-- HTH, Ted







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manually obtain previous action parameters after action "chaining"?

2007-11-07 Thread Dave Newton
You could try exposing ActionSupport's
actionMessages/fieldErrors/etc by putting getters in
your first action; I'm not quite sure how the chain
interceptor decides how to copy properties though.

d.

--- jjgould <[EMAIL PROTECTED]> wrote:

> 
> Ted, et. al.,
> 
> I am also interested in accessing the previous
> action from the target action
> of a "chain" result.  But, the reason I want to get
> to that action is not
> because of any bean properties, but because I need
> the action errors, action
> messages, and field errors that may have been placed
> there by my validation.
> 
> In my case, action "one" is used to view an object
> that is an aggregate of a
> lot of smaller objects.  Action "two" is used to add
> a new component object
> to the collection.  However, when there is a
> validation error on the new
> object, the application needs to forward back to
> action "one" to redisplay
> the object and it needs to have the field error
> messages.  The struts.xml
> looks like this:
> 
>  name="*/view"
>
> class="com.sherwin.sd.eris.web.action.CaseAction"
> method="execute">
> {1}
> 
name="success">/WEB-INF/jsp/case/viewCase.jsp
> 
> 
>  name="*/issue/add"
>
> class="com.sherwin.sd.eris.web.action.IssueAction"
> method="addIssue">
> {1}
>  name="input"
> type="chain">
> {1}/view
> 
>  name="success"
> type="redirect-action">
> {1}/view
> 
> 
> 
> Any tips you can offer are greatly appreciated.
> 
> - Jack Gould
>   Sherwin-Williams
>   Cleveland, Ohio, USA
> 
> 
> Ted Husted wrote:
> > 
> > Binding two Action classes together that way
> sounds like a "slippery
> > slope" to me. It seems like a better practice to
> rely on standard
> > JavaBean semantics, and access the values that
> need to be brought
> > forward through the usual get and set methods.
> > 
> > One other thing to try, which you may have started
> to do, would be to
> > save the object as a request attribute, as an
> alternative to the chain
> > result. In this case, both Actions would have
> setRequest and
> > getRequest methods.
> > 
> > ActionOne
> > 
>
getRequest().put("searchParameter",getSearchParameter());
> > 
> > ActionTwo
> >  setSearchParameter( (SearchParameter)
> getRequest().get("searchParameter")
> > );
> > 
> > The JVM is optimized for property methods, and
> overall it's a better
> > practice to go through the getters and setters
> than access fields
> > directly.
> > 
> > -- HTH, Ted
> > 
> > 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13640692
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manually obtain previous action parameters after action "chaining"?

2007-11-07 Thread jjgould

Ted, et. al.,

I am also interested in accessing the previous action from the target action
of a "chain" result.  But, the reason I want to get to that action is not
because of any bean properties, but because I need the action errors, action
messages, and field errors that may have been placed there by my validation.

In my case, action "one" is used to view an object that is an aggregate of a
lot of smaller objects.  Action "two" is used to add a new component object
to the collection.  However, when there is a validation error on the new
object, the application needs to forward back to action "one" to redisplay
the object and it needs to have the field error messages.  The struts.xml
looks like this:


{1}
/WEB-INF/jsp/case/viewCase.jsp



{1}

{1}/view


{1}/view



Any tips you can offer are greatly appreciated.

- Jack Gould
  Sherwin-Williams
  Cleveland, Ohio, USA


Ted Husted wrote:
> 
> Binding two Action classes together that way sounds like a "slippery
> slope" to me. It seems like a better practice to rely on standard
> JavaBean semantics, and access the values that need to be brought
> forward through the usual get and set methods.
> 
> One other thing to try, which you may have started to do, would be to
> save the object as a request attribute, as an alternative to the chain
> result. In this case, both Actions would have setRequest and
> getRequest methods.
> 
> ActionOne
>  getRequest().put("searchParameter",getSearchParameter());
> 
> ActionTwo
>  setSearchParameter( (SearchParameter) getRequest().get("searchParameter")
> );
> 
> The JVM is optimized for property methods, and overall it's a better
> practice to go through the getters and setters than access fields
> directly.
> 
> -- HTH, Ted
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13640692
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manually obtain previous action parameters after action "chaining"?

2007-10-11 Thread Ted Husted
Binding two Action classes together that way sounds like a "slippery
slope" to me. It seems like a better practice to rely on standard
JavaBean semantics, and access the values that need to be brought
forward through the usual get and set methods.

One other thing to try, which you may have started to do, would be to
save the object as a request attribute, as an alternative to the chain
result. In this case, both Actions would have setRequest and
getRequest methods.

ActionOne
 getRequest().put("searchParameter",getSearchParameter());

ActionTwo
 setSearchParameter( (SearchParameter) getRequest().get("searchParameter") );

The JVM is optimized for property methods, and overall it's a better
practice to go through the getters and setters than access fields
directly.

-- HTH, Ted



On 10/11/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:
>
> Thank you for the answer.
>
> I see that properties are copied. But the property must be in javaBean spec.
> otherwise subpropirties are not copied. I think that i can get previos
> Action and manualy get whole property as object. The copy process in
> ChainInterceptor rely on OGNL and  look like "magik".
>
> If there is not any ability to get a previous action  and its properties
> manually after ChainResult, I agree to rely on  ChainInterceptor.
>
> I posted a detailed message
> http://www.nabble.com/-S2--NULL-Session-object-after-execAndWait-interceptor.-Why--tf4600442.html
> about session object and strange behavior after execAndWait interceptor
>
>
> Ted Husted wrote:
> >
> > The Action itself is not copied over, the PROPERTIES are copied. If
> > the properties in common are copied forward, then there should be no
> > need to address the prior Action class directly. Any methods that need
> > to be called by more than one Action should be moved to a base support
> > class that the Actions can share.
> >
> > Also, there is rarely a need to use HTTP semantic in a Struts 2
> > Action. The SessionAware and RequestAware interceptors expose the
> > session and request attributes as entries in Maps. request.getSession
> > doesn't work, because the interceptor doesn't pass the HttpRequest
> > object but a map the proxies the attributes in request scope. If the
> > Action needs access to the session attributes, then implement
> > setSession(Map).
> >
> > -Ted.
> >
> >
> > On 10/11/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:
> >>
> >> 1. I have "actionOne"
> >>
> >> public class ActionOne extends ActionSupport implements
> >> ServletRequestAware{
> >>   protected HttpServletRequest request;
> >>
> >>   private SearchParameter searchData=new SearchParameter();//My complex
> >> object
> >>
> >>   public String execute() throws Exception{
> >>  //fill searchData with parameters. Many many parameters.
> >>   return this.SUCCESS;
> >>   }
> >>
> >>   // this is for ability to copy object searchData to next chain action
> >>   public SearchParameter getSearchData() {
> >> return searchData;
> >>   }
> >>
> >>   public void setServletRequest(HttpServletRequest httpServletRequest) {
> >> request = httpServletRequest;
> >>   }
> >>
> >> }
> >>
> >> 2.
> >>>> extends="struts-default">
> >> 
> >>   doSearch
> >>   search.jsp 
> >> 
> >> 
> >> 
> >>   
> >>   
> >> 2000
> >> 500
> >>   
> >>   wait_search.jsp
> >>>> >search_result.jsp
> >> 
> >>   
> >>
> >> 3.
> >> public class ActionTwo  extends ActionSupport implements
> >> ServletRequestAware
> >> {
> >>   protected HttpServletRequest request;
> >>   private SearchParameter searchData;
> >>   private HttpSession sess;
> >>   public String execute() throws Exception{
> >>  sess = request.getSession();
> >>  boolean v =(searchData!=null);// ok. we recieve a copy of searchData
> >> from previos action
> >>  try {  Thread.currentThread().sleep(6*1000);  } catch
> >> (InterruptedException ex) {}
> >>  sess = request.getSession(); // return null object!!! why ?
> >>  return this.SUCCESS;
> >>   }
> >>   /*this work and  searchData object has been copied from previos action
> >> */
> >>   public void setSearchData(SearchParameter searchData) {
> >> this.searchData = searchData;
> >>   }
> >> }
> >>
> >> The desired behaviour:
> >>
> >> public class ActionTwo  extends ActionSupport implements
> >> ServletRequestAware
> >> {
> >>   protected HttpServletRequest request;
> >>   private HttpSession sess;
> >>   public String execute() throws Exception{
> >>  SearchParameter searchData=null;
> >>  try {  Thread.currentThread().sleep(6*1000);  } catch
> >> (InterruptedException ex) {}
> >>  //
> >>   ActionOne prev=null;
> >>   prev=(ActionOne)getPreviousAction();
> >>   searchData=prev.getSearchData();
> >>  //
> >>  sess = request.getSession(); // return null object!!! why ?
> >>  return this.SUCCESS;
> >>   }
> >>
> >> }
> >> ===

Re: Manually obtain previous action parameters after action "chaining"?

2007-10-11 Thread Igor Vlasov

Thank you for the answer.

I see that properties are copied. But the property must be in javaBean spec.
otherwise subpropirties are not copied. I think that i can get previos
Action and manualy get whole property as object. The copy process in
ChainInterceptor rely on OGNL and  look like "magik".

If there is not any ability to get a previous action  and its properties
manually after ChainResult, I agree to rely on  ChainInterceptor.

I posted a detailed message 
http://www.nabble.com/-S2--NULL-Session-object-after-execAndWait-interceptor.-Why--tf4600442.html
 
about session object and strange behavior after execAndWait interceptor  


Ted Husted wrote:
> 
> The Action itself is not copied over, the PROPERTIES are copied. If
> the properties in common are copied forward, then there should be no
> need to address the prior Action class directly. Any methods that need
> to be called by more than one Action should be moved to a base support
> class that the Actions can share.
> 
> Also, there is rarely a need to use HTTP semantic in a Struts 2
> Action. The SessionAware and RequestAware interceptors expose the
> session and request attributes as entries in Maps. request.getSession
> doesn't work, because the interceptor doesn't pass the HttpRequest
> object but a map the proxies the attributes in request scope. If the
> Action needs access to the session attributes, then implement
> setSession(Map).
> 
> -Ted.
> 
> 
> On 10/11/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:
>>
>> 1. I have "actionOne"
>>
>> public class ActionOne extends ActionSupport implements
>> ServletRequestAware{
>>   protected HttpServletRequest request;
>>
>>   private SearchParameter searchData=new SearchParameter();//My complex
>> object
>>
>>   public String execute() throws Exception{
>>  //fill searchData with parameters. Many many parameters.
>>   return this.SUCCESS;
>>   }
>>
>>   // this is for ability to copy object searchData to next chain action
>>   public SearchParameter getSearchData() {
>> return searchData;
>>   }
>>
>>   public void setServletRequest(HttpServletRequest httpServletRequest) {
>> request = httpServletRequest;
>>   }
>>
>> }
>>
>> 2.
>>   > extends="struts-default">
>> 
>>   doSearch
>>   search.jsp 
>> 
>> 
>> 
>>   
>>   
>> 2000
>> 500
>>   
>>   wait_search.jsp
>>   > >search_result.jsp
>> 
>>   
>>
>> 3.
>> public class ActionTwo  extends ActionSupport implements
>> ServletRequestAware
>> {
>>   protected HttpServletRequest request;
>>   private SearchParameter searchData;
>>   private HttpSession sess;
>>   public String execute() throws Exception{
>>  sess = request.getSession();
>>  boolean v =(searchData!=null);// ok. we recieve a copy of searchData
>> from previos action
>>  try {  Thread.currentThread().sleep(6*1000);  } catch
>> (InterruptedException ex) {}
>>  sess = request.getSession(); // return null object!!! why ?
>>  return this.SUCCESS;
>>   }
>>   /*this work and  searchData object has been copied from previos action
>> */
>>   public void setSearchData(SearchParameter searchData) {
>> this.searchData = searchData;
>>   }
>> }
>>
>> The desired behaviour:
>>
>> public class ActionTwo  extends ActionSupport implements
>> ServletRequestAware
>> {
>>   protected HttpServletRequest request;
>>   private HttpSession sess;
>>   public String execute() throws Exception{
>>  SearchParameter searchData=null;
>>  try {  Thread.currentThread().sleep(6*1000);  } catch
>> (InterruptedException ex) {}
>>  //
>>   ActionOne prev=null;
>>   prev=(ActionOne)getPreviousAction();
>>   searchData=prev.getSearchData();
>>  //
>>  sess = request.getSession(); // return null object!!! why ?
>>  return this.SUCCESS;
>>   }
>>
>> }
>> ===
>> for simplisity simplicity searchData may be a simple Object().
>> I need an ability to make : prev=(ActionOne)getPreviousAction();
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13155261
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manually obtain previous action parameters after action "chaining"?

2007-10-11 Thread Ted Husted
The Action itself is not copied over, the PROPERTIES are copied. If
the properties in common are copied forward, then there should be no
need to address the prior Action class directly. Any methods that need
to be called by more than one Action should be moved to a base support
class that the Actions can share.

Also, there is rarely a need to use HTTP semantic in a Struts 2
Action. The SessionAware and RequestAware interceptors expose the
session and request attributes as entries in Maps. request.getSession
doesn't work, because the interceptor doesn't pass the HttpRequest
object but a map the proxies the attributes in request scope. If the
Action needs access to the session attributes, then implement
setSession(Map).

-Ted.


On 10/11/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:
>
> 1. I have "actionOne"
>
> public class ActionOne extends ActionSupport implements ServletRequestAware{
>   protected HttpServletRequest request;
>
>   private SearchParameter searchData=new SearchParameter();//My complex
> object
>
>   public String execute() throws Exception{
>  //fill searchData with parameters. Many many parameters.
>   return this.SUCCESS;
>   }
>
>   // this is for ability to copy object searchData to next chain action
>   public SearchParameter getSearchData() {
> return searchData;
>   }
>
>   public void setServletRequest(HttpServletRequest httpServletRequest) {
> request = httpServletRequest;
>   }
>
> }
>
> 2.
>extends="struts-default">
> 
>   doSearch
>   search.jsp 
> 
> 
> 
>   
>   
> 2000
> 500
>   
>   wait_search.jsp
>   search_result.jsp
> 
>   
>
> 3.
> public class ActionTwo  extends ActionSupport implements ServletRequestAware
> {
>   protected HttpServletRequest request;
>   private SearchParameter searchData;
>   private HttpSession sess;
>   public String execute() throws Exception{
>  sess = request.getSession();
>  boolean v =(searchData!=null);// ok. we recieve a copy of searchData
> from previos action
>  try {  Thread.currentThread().sleep(6*1000);  } catch
> (InterruptedException ex) {}
>  sess = request.getSession(); // return null object!!! why ?
>  return this.SUCCESS;
>   }
>   /*this work and  searchData object has been copied from previos action */
>   public void setSearchData(SearchParameter searchData) {
> this.searchData = searchData;
>   }
> }
>
> The desired behaviour:
>
> public class ActionTwo  extends ActionSupport implements ServletRequestAware
> {
>   protected HttpServletRequest request;
>   private HttpSession sess;
>   public String execute() throws Exception{
>  SearchParameter searchData=null;
>  try {  Thread.currentThread().sleep(6*1000);  } catch
> (InterruptedException ex) {}
>  //
>   ActionOne prev=null;
>   prev=(ActionOne)getPreviousAction();
>   searchData=prev.getSearchData();
>  //
>  sess = request.getSession(); // return null object!!! why ?
>  return this.SUCCESS;
>   }
>
> }
> ===
> for simplisity simplicity searchData may be a simple Object().
> I need an ability to make : prev=(ActionOne)getPreviousAction();


Re: Manually obtain previous action parameters after action "chaining"?

2007-10-11 Thread Igor Vlasov

1. I have "actionOne"

public class ActionOne extends ActionSupport implements ServletRequestAware{
  protected HttpServletRequest request;

  private SearchParameter searchData=new SearchParameter();//My complex
object

  public String execute() throws Exception{
 //fill searchData with parameters. Many many parameters.
  return this.SUCCESS;
  }

  // this is for ability to copy object searchData to next chain action 
  public SearchParameter getSearchData() {
return searchData;
  }

  public void setServletRequest(HttpServletRequest httpServletRequest) {
request = httpServletRequest; 
  }
  
}

2.
  

  doSearch
  search.jsp 



  
  
2000
500 
  
  wait_search.jsp
  search_result.jsp

  

3.
public class ActionTwo  extends ActionSupport implements ServletRequestAware
{
  protected HttpServletRequest request;
  private SearchParameter searchData;
  private HttpSession sess;
  public String execute() throws Exception{
 sess = request.getSession();
 boolean v =(searchData!=null);// ok. we recieve a copy of searchData
from previos action
 try {  Thread.currentThread().sleep(6*1000);  } catch
(InterruptedException ex) {}
 sess = request.getSession(); // return null object!!! why ?
 return this.SUCCESS;
  }
  /*this work and  searchData object has been copied from previos action */
  public void setSearchData(SearchParameter searchData) {
this.searchData = searchData;
  }
}

The desired behaviour:

public class ActionTwo  extends ActionSupport implements ServletRequestAware
{
  protected HttpServletRequest request;
  private HttpSession sess;
  public String execute() throws Exception{
 SearchParameter searchData=null;
 try {  Thread.currentThread().sleep(6*1000);  } catch
(InterruptedException ex) {}
 //
  ActionOne prev=null;
  prev=(ActionOne)getPreviousAction();
  searchData=prev.getSearchData();
 //
 sess = request.getSession(); // return null object!!! why ?
 return this.SUCCESS;
  }
 
}
===
for simplisity simplicity searchData may be a simple Object().
I need an ability to make : prev=(ActionOne)getPreviousAction();


Laurie Harper wrote:
> 
> Igor Vlasov wrote:
>> Copying of properties with ChainingInterceptor  working GOOD.
> 
> OK, good that something is working well. What's not clear is what 
> *isn't* working...
> 
> Can you post code that works (as a semplar), and then a sample of the 
> code you'd like to write instead (to illustrate what you're looking for)?
> 
> L.
> 
 I have action "one" and it calls action "two" throw:
  two


 I can use ChainingInterceptor to copy properties of "one" action to
 "two"
 action.

 I get behaviour : one.param->two.param.
 But the property "param" must be in  javaBeans specification(have
 setter
 and
 getter method for each property).

 Can i MANUALLY get object for "one" action or exact "one.property" from
 :"execute()" method of action "two"?
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13152366
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manually obtain previous action parameters after action "chaining"?

2007-10-11 Thread Laurie Harper

Igor Vlasov wrote:

Copying of properties with ChainingInterceptor  working GOOD.


OK, good that something is working well. What's not clear is what 
*isn't* working...



I have very complex object as a property to copy and i MUST make every part
of it in javaBean specification. For me it is too tedious. Then  i want
manually copy whole property from  actionOne to  actionTwo.

The second cause is process of copying. It is sometime like "magic" and copy
many objects (from action support itself.). And i want to copy just one my
property.


Can you post code that works (as a semplar), and then a sample of the 
code you'd like to write instead (to illustrate what you're looking for)?


L.


Ted Husted wrote:

The use case for the chain result is that JavaBean properties on
ActionTwo that match JavaBean properties on ActionOne are copied
forward. This sounds like the same use case that you describe, and
it's unclear why it isn't working, or why you would need to do
anything manually.

The most helpful thing would be to include the relevant source code
from your Actions and struts.xml

HTH, Ted.
http://www.catb.org/~esr/faqs/smart-questions.html


On 10/10/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:

I have action "one" and it calls action "two" throw:
 two


I can use ChainingInterceptor to copy properties of "one" action to "two"
action.

I get behaviour : one.param->two.param.
But the property "param" must be in  javaBeans specification(have setter
and
getter method for each property).

Can i MANUALLY get object for "one" action or exact "one.property" from
:"execute()" method of action "two"?


--
View this message in context:
http://www.nabble.com/Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13136989
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
HTH, Ted 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manually obtain previous action parameters after action "chaining"?

2007-10-10 Thread Igor Vlasov

Copying of properties with ChainingInterceptor  working GOOD.
I have very complex object as a property to copy and i MUST make every part
of it in javaBean specification. For me it is too tedious. Then  i want
manually copy whole property from  actionOne to  actionTwo.

The second cause is process of copying. It is sometime like "magic" and copy
many objects (from action support itself.). And i want to copy just one my
property.




Ted Husted wrote:
> 
> The use case for the chain result is that JavaBean properties on
> ActionTwo that match JavaBean properties on ActionOne are copied
> forward. This sounds like the same use case that you describe, and
> it's unclear why it isn't working, or why you would need to do
> anything manually.
> 
> The most helpful thing would be to include the relevant source code
> from your Actions and struts.xml
> 
> HTH, Ted.
> http://www.catb.org/~esr/faqs/smart-questions.html
> 
> 
> On 10/10/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:
>>
>> I have action "one" and it calls action "two" throw:
>>  two
>>
>>
>> I can use ChainingInterceptor to copy properties of "one" action to "two"
>> action.
>>
>> I get behaviour : one.param->two.param.
>> But the property "param" must be in  javaBeans specification(have setter
>> and
>> getter method for each property).
>>
>> Can i MANUALLY get object for "one" action or exact "one.property" from
>> :"execute()" method of action "two"?
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13136989
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> HTH, Ted 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13149804
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manually obtain previous action parameters after action "chaining"?

2007-10-10 Thread Ted Husted
The use case for the chain result is that JavaBean properties on
ActionTwo that match JavaBean properties on ActionOne are copied
forward. This sounds like the same use case that you describe, and
it's unclear why it isn't working, or why you would need to do
anything manually.

The most helpful thing would be to include the relevant source code
from your Actions and struts.xml

HTH, Ted.
http://www.catb.org/~esr/faqs/smart-questions.html


On 10/10/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:
>
> I have action "one" and it calls action "two" throw:
>  two
>
>
> I can use ChainingInterceptor to copy properties of "one" action to "two"
> action.
>
> I get behaviour : one.param->two.param.
> But the property "param" must be in  javaBeans specification(have setter and
> getter method for each property).
>
> Can i MANUALLY get object for "one" action or exact "one.property" from
> :"execute()" method of action "two"?
>
>
> --
> View this message in context: 
> http://www.nabble.com/Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13136989
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
HTH, Ted 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] Manually obtain previous action parameters after action "chaining"?

2007-10-10 Thread Igor Vlasov

I try this in action "two".execute():

ValueStack stack=ActionContext.getContext().getValueStack();
CompoundRoot root = stack.getRoot();
List list = new ArrayList(root);


This list does not contain my previous action "one". It contains only
TextProviderObject.

Can you write  how to "grab the ValueStck and traverse it up"?



-- 
View this message in context: 
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13137399
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] Manually obtain previous action parameters after action "chaining"?

2007-10-10 Thread cilquirm

You can, if you grab the ValueStck and traverse up it till you get to your
previous action. 



Igor Vlasov wrote:
> 
> 
> 
> I have action "one" and it calls action "two" throw:
>  two
> 
> 
> I can use ChainingInterceptor to copy properties of "one" action to "two"
> action.
> 
> I get behaviour : one.param->two.param. 
> But the property "param" must be in  javaBeans specification(have setter
> and getter method for each property).
> 
> Can i MANUALLY get object for "one" action or exact "one.property" from
> :"execute()" method of action "two"?
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13137301
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] Manually obtain previous action parameters after action "chaining"?

2007-10-10 Thread Igor Vlasov

I have action "one" and it calls action "two" throw:
 two


I can use ChainingInterceptor to copy properties of "one" action to "two"
action.

I get behaviour : one.param->two.param. 
But the property "param" must be in  javaBeans specification(have setter and
getter method for each property).

Can i MANUALLY get object for "one" action or exact "one.property" from
:"execute()" method of action "two"?


-- 
View this message in context: 
http://www.nabble.com/-S2--Manually-obtain-previous-action-parameters-after-action-%22chaining%22--tf4601173.html#a13136989
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-07 Thread Dave Newton
--- Allen Gilliland <[EMAIL PROTECTED]> wrote:
> So, now all I really need to know is if there is a
> way that I can just flat out disable all of
struts2's
> validation stuff but still have my actions extend 
> ActionSupport?  

Create an interceptor stack without the validation
stuff.

> I would also technically consider this a bug because
> IMO I should be allowed to set action errors and 
> chain to other actions without having 
> validation break my chaining.

It's not a bug, it's a feature!

(Jokes aside, I would not in any way consider that a
bug.)

> My guess is that the validation code is 
> using the hasActionErrors() method to determine if
> the 'input' result should be sent after validation, 
> but that seems suboptimal.  It would be better if
the
> validation actually tracked if it had actually
failed
>  any of its validation checks and only modify the 
> result then, not just because there is an action 
> error.

But that's what the validation stuff is for; if
there's errors, go back to the input, regardless of
where the errors came from. That requires less work on
the programmers side: add an error, it goes back to
the input that caused the error.

If you want to circumvent default behavior just
redefine your interceptor stack, although you'll lose
the built-in validation handling then.

d.



 

Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-07 Thread Allen Gilliland

Thanks Laurie, that was what I needed to do.

Turns out that my action was setting an action error before doing its 
chaining and so when validation was triggered on the chained action it 
was thinking an error had occurred and forcing the "input" result.


So, now all I really need to know is if there is a way that I can just 
flat out disable all of struts2's validation stuff but still have my 
actions extend ActionSupport?  Is there something I can put in my 
struts.xml file to prevent validation from running against my actions?


I would also technically consider this a bug because IMO I should be 
allowed to set action errors and chain to other actions without having 
validation break my chaining.  My guess is that the validation code is 
using the hasActionErrors() method to determine if the 'input' result 
should be sent after validation, but that seems suboptimal.  It would be 
better if the validation actually tracked if it had actually failed any 
of its validation checks and only modify the result then, not just 
because there is an action error.


-- Allen


Laurie Harper wrote:
As well as validation errors, there could still be conversion errors. 
You said you don't have any conversions configured but remember that 
Struts will apply default converters if you have any setters on the 
action that take non-String arguments (assuming the request includes an 
attribute that matches that setter).


I would suggest setting up an 'input' result pointing to a simple JSP 
page with s:actionerror, s:actionmessage and s:debug tags on it. Maybe 
you'll find a clue as to what's wrong there.


L.

Allen Gilliland wrote:



Dave Newton wrote:

--- Allen Gilliland <[EMAIL PROTECTED]> wrote:

I can't see any reason why validation would be doing
anything at all unless somehow the validation interceptor wants to 
use one of the methods in my action class for validation when i 
didn't intend that.


So you have no *-validation.xml files? No methods
named validate*?


nope, no *-validation.xml files and no validate* methods.  i do have a 
myValidate() method in some actions which i started using after 
realizing that i couldn't use validate().


-- Allen




Hrm.

d

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-04 Thread Laurie Harper
As well as validation errors, there could still be conversion errors. 
You said you don't have any conversions configured but remember that 
Struts will apply default converters if you have any setters on the 
action that take non-String arguments (assuming the request includes an 
attribute that matches that setter).


I would suggest setting up an 'input' result pointing to a simple JSP 
page with s:actionerror, s:actionmessage and s:debug tags on it. Maybe 
you'll find a clue as to what's wrong there.


L.

Allen Gilliland wrote:



Dave Newton wrote:

--- Allen Gilliland <[EMAIL PROTECTED]> wrote:

I can't see any reason why validation would be doing
anything at all unless somehow the validation interceptor wants to 
use one of the methods in my action class for validation when i 
didn't intend that.


So you have no *-validation.xml files? No methods
named validate*?


nope, no *-validation.xml files and no validate* methods.  i do have a 
myValidate() method in some actions which i started using after 
realizing that i couldn't use validate().


-- Allen




Hrm.

d

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Allen Gilliland



Dave Newton wrote:

--- Allen Gilliland <[EMAIL PROTECTED]> wrote:

I can't see any reason why validation would be doing
anything at all unless somehow the validation 
interceptor wants to use one of the methods in my 
action class for validation when i didn't intend 
that.


So you have no *-validation.xml files? No methods
named validate*?


nope, no *-validation.xml files and no validate* methods.  i do have a 
myValidate() method in some actions which i started using after 
realizing that i couldn't use validate().


-- Allen




Hrm.

d

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Daniel Ruan

Or maybe the @SkipValidation annotation?

On 5/3/07, Martin Gainty <[EMAIL PROTECTED]> wrote:


struts-default.xml has the ability to exclude methods as in this example
which excludes methods (method1, method2) from validation


method1,method2


Martin--



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Martin Gainty
struts-default.xml has the ability to exclude methods as in this example 
which excludes methods (method1, method2) from validation



method1,method2


Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Dave Newton" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Thursday, May 03, 2007 9:38 PM
Subject: Re: [s2] problem with action chaining returning "input" result



--- Allen Gilliland <[EMAIL PROTECTED]> wrote:

I can't see any reason why validation would be doing
anything at all unless somehow the validation
interceptor wants to use one of the methods in my
action class for validation when i didn't intend
that.


So you have no *-validation.xml files? No methods
named validate*?

Hrm.

d

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Dave Newton
--- Allen Gilliland <[EMAIL PROTECTED]> wrote:
> I can't see any reason why validation would be doing
> anything at all unless somehow the validation 
> interceptor wants to use one of the methods in my 
> action class for validation when i didn't intend 
> that.

So you have no *-validation.xml files? No methods
named validate*?

Hrm.

d

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Allen Gilliland



Dave Newton wrote:

--- Allen Gilliland <[EMAIL PROTECTED]> wrote:

public abstract class UIAction extends ActionSupport


Okay, so now the question is why it thinks there's a
validation error on your subclass-we know *why* it's
trying to validate (ActionSupport implements the
validation interfaces).

Are there *any* validation files (etc) in your app?
Any that are for the model being submitted to the
subclass? Does the superclass implement a validation
method?


Any validation that is happening would be accidental, I have not 
configured anything to actually try to use the struts2 validation.


This is the top of my config where all the interesting stuff happens, 
everything else is just action definitions and none of my actions 
contain any elements other than results.



extends="struts-default">




class="org.apache.struts2.views.tiles.TilesResult" />






















I can't see any reason why validation would be doing anything at all 
unless somehow the validation interceptor wants to use one of the 
methods in my action class for validation when i didn't intend that.


-- Allen




Process of elimination :)

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Dave Newton
--- Allen Gilliland <[EMAIL PROTECTED]> wrote:
> public abstract class UIAction extends ActionSupport

Okay, so now the question is why it thinks there's a
validation error on your subclass-we know *why* it's
trying to validate (ActionSupport implements the
validation interfaces).

Are there *any* validation files (etc) in your app?
Any that are for the model being submitted to the
subclass? Does the superclass implement a validation
method?

Process of elimination :)

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Allen Gilliland



Dave Newton wrote:

--- Allen Gilliland <[EMAIL PROTECTED]> wrote:

[...] i removed all my old validation() methods so i



know it's not that.

public class Members extends UIAction 


What does UIAction look like (specifically with
regards to interfaces implements and superclasses)?


UIAction is a base class which all of my actions extend and basically it 
just builds some additional application specific features on top of the 
ActionSupport class.  I won't include the whole thing, but here's a 
sample ...


public abstract class UIAction extends ActionSupport
implements UIActionPreparable, UISecurityEnforced {

// a common result name used to indicate the result should list 
some data

public static final String LIST = "list";

// the authenticated user accessing this action, or null if client 
is not logged in

private UserData authenticatedUser = null;

// the weblog this action is intended to work on, or null if no 
weblog specified

private WebsiteData actionWeblog = null;

// page title
protected String pageTitle = null;


public void myPrepare() {
// no-op
}

public String getAbsoluteSiteURL() {
return RollerRuntimeConfig.getAbsoluteContextURL();
}

// access an application config property
public String getProp(String key) {
// first try static config
String value = RollerConfig.getProperty(key);
if(value == null) {
value = RollerRuntimeConfig.getProperty(key);
}

return (value == null) ? key : value;
}

public void addError(String errorKey) {
addActionError(getText(errorKey));
}

public void addError(String errorKey, String param) {
addActionError(getText(errorKey, errorKey, param));
}

public void addError(String errorKey, List args) {
addActionError(getText(errorKey, args));
}

// list of locales to display in web form dropdowns
public List getLocalesList() {
return UIUtils.getLocales();
}

// list of time zones to display in web form dropdowns
public List getTimeZonesList() {
return UIUtils.getTimeZones();
}

}


As I said above, all my actions extend UIAction, so I would think if 
there were a problem there then i would be seeing it on all my actions.


The 2 interfaces it implements are custom interfaces which work 
basically the same way the struts2 XXXAware interfaces work.  They are 
coupled with custom interceptors which take a look at the request/action 
before the action method is executed and do some prework.  This is what 
they look like ...


public interface UIActionPreparable {

public void myPrepare();
}

public interface UISecurityEnforced {

public boolean isUserRequired();

public boolean isWeblogRequired();

public String requiredUserRole();

public short requiredWeblogPermissions();
}


From the debugging output I can see that when struts2 is trying to 
execute the action I am chaining to it never actually gets to my custom 
interceptors, so I don't think the problem is there.  Plus, none of my 
custom interceptors return "input" as a result.


not sure what else it could be :(

-- Allen




There must be *some* reason validation is running.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Dave Newton
--- Allen Gilliland <[EMAIL PROTECTED]> wrote:
> [...] i removed all my old validation() methods so i

> know it's not that.
> 
> public class Members extends UIAction 

What does UIAction look like (specifically with
regards to interfaces implements and superclasses)?

There must be *some* reason validation is running.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Allen Gilliland



Laurie Harper wrote:

Allen Gilliland wrote:
when chaining from one action to another, why is struts2 trying to 
lookup the "input" result on action2 before ever executing my action 
method?


i have a simple config, like the examples in the documentation ...


.Members



.MembersInvite
.disabled
members


when i execute the 'invite' action it stores an invitation in the db 
and adds an action message to notify the user and then i return 
SUCCESS, which should just chain to the execute() method of my 
'members' action right?


well when i do this everything works properly in the 'invite' action 
and through debugging i can see that my 'members' action class is 
instantiated as if it's going to be executed, but the execute() method 
is never called and struts2 gives an error about not being able to 
find the "input" result on my 'members' action.  why is this happening?


No result defined for action 
org.apache.roller.ui.authoring.struts2.Members and result input


Well, firstly, you don't have a result named 'input' on your members 
action... but I guess you're more interested in why Struts is looking 
for it :-)


yep, and i don't need an 'input' result on that action.  the baffling 
part to me is why struts2 is even trying to look for that result when 
nothing in my action returns that result.





Does the members action have any conversion or validation configured? 
Struts will automatically forward to the 'input' result if errors occur 
during conversion or validation. If that's not it, you'll need to post 
more details, such as your action code and anything written to the logs 
as the request is being processed.


nope, no conversion or validation.  i ran into the problem with the 
validation interceptor when i first started working with struts2 and 
mistakenly had a validation() method in my action without realizing 
struts2 was going to execute that method without my knowledge, but i 
removed all my old validation() methods so i know it's not that.


i'll post the skeleton of the action class if that will help, but it's 
quite simple.


public class Members extends UIAction implements ParameterAware {

private static Log log = LogFactory.getLog(Members.class);

// raw parameters from request
private Map parameters = Collections.EMPTY_MAP;


public Members() {
log.debug("Instantiating members action");
}

public String execute() {

log.debug("Showing weblog members page");

return LIST;
}

public String save() {

log.debug("Attempting to processing weblog permissions updates");

... do work ...

return LIST;
}

// convenience for accessing a single parameter with a single value
public String getParameter(String key) ...

public Map getParameters() ...

public void setParameters(Map parameters) ...
}


here's the full debugging output from my logs showing that the first 
action successfully completes and returns a SUCCESS result which chains 
to the second action, but I can't figure out what is causing struts2 to 
bail on the chain execution before even calling my action method ...


DEBUG 2007-05-03 14:42:57,717 MembersInvite:save - Invitation 
successfully recorded
DEBUG 2007-05-03 14:42:57,727 ActionChainResult:execute - Chaining to 
action members
DEBUG 2007-05-03 14:42:57,729 DefaultActionProxy: - Creating an 
DefaultActionProxy for namespace /roller-ui/authoring and action name 
members
DEBUG 2007-05-03 14:42:57,731 ActionConfigMatcher:match - Attempting to 
match 'members' to a wildcard pattern, 32 available
DEBUG 2007-05-03 14:42:57,733 ActionConfigMatcher:match - Path matches 
pattern 'members!*'

DEBUG 2007-05-03 14:42:57,735 Members: - Instantiating members action
DEBUG 2007-05-03 14:42:57,737 I18nInterceptor:intercept - intercept 
'/roller-ui/authoring/members' {
DEBUG 2007-05-03 14:42:57,739 I18nInterceptor:intercept - 
requested_locale=null
DEBUG 2007-05-03 14:42:57,741 I18nInterceptor:intercept - before 
Locale=en_US
DEBUG 2007-05-03 14:42:57,763 InstantiatingNullHandler:nullPropertyValue 
- Entering nullPropertyValue 
[EMAIL PROTECTED], 
[EMAIL PROTECTED], 
[EMAIL PROTECTED], property=inviteMember]
DEBUG 2007-05-03 14:42:57,775 InstantiatingNullHandler:nullPropertyValue 
- Entering nullPropertyValue 
[EMAIL PROTECTED], 
[EMAIL PROTECTED], 
[EMAIL PROTECTED], property=struts]
DEBUG 2007-05-03 14:42:57,791 FileUploadInterceptor:intercept - 
Bypassing /roller-ui/authoring/ members
DEBUG 2007-05-03 14:42:57,793 StaticParametersInterceptor:intercept - 
Setting static parameters {}
DEBUG 2007-05-03 14:42:57,796 ParametersInterceptor:intercept - Setting 
params userName => [ blah ] weblog => [ test ] inviteMember.button.save 
=> [ Send Invitation ] permission => [ 1 ]
DEBUG 2007-05-03 14:42:57,799 InstantiatingNullHandler:nullPropertyValue 
- Entering nullPropertyValue 
[EMAIL PROTECTED], 
[EMAIL PROTECTED], 
[EMAIL PROTECTED], property=inviteMember]
ERROR 2007-05-03 14:42

Re: [s2] problem with action chaining returning "input" result

2007-05-03 Thread Laurie Harper

Allen Gilliland wrote:
when chaining from one action to another, why is struts2 trying to 
lookup the "input" result on action2 before ever executing my action 
method?


i have a simple config, like the examples in the documentation ...


.Members



.MembersInvite
.disabled
members


when i execute the 'invite' action it stores an invitation in the db and 
adds an action message to notify the user and then i return SUCCESS, 
which should just chain to the execute() method of my 'members' action 
right?


well when i do this everything works properly in the 'invite' action and 
through debugging i can see that my 'members' action class is 
instantiated as if it's going to be executed, but the execute() method 
is never called and struts2 gives an error about not being able to find 
the "input" result on my 'members' action.  why is this happening?


No result defined for action 
org.apache.roller.ui.authoring.struts2.Members and result input


Well, firstly, you don't have a result named 'input' on your members 
action... but I guess you're more interested in why Struts is looking 
for it :-)


Does the members action have any conversion or validation configured? 
Struts will automatically forward to the 'input' result if errors occur 
during conversion or validation. If that's not it, you'll need to post 
more details, such as your action code and anything written to the logs 
as the request is being processed.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2] problem with action chaining returning "input" result

2007-05-03 Thread Allen Gilliland
when chaining from one action to another, why is struts2 trying to 
lookup the "input" result on action2 before ever executing my action method?


i have a simple config, like the examples in the documentation ...


.Members



.MembersInvite
.disabled
members


when i execute the 'invite' action it stores an invitation in the db and 
adds an action message to notify the user and then i return SUCCESS, 
which should just chain to the execute() method of my 'members' action 
right?


well when i do this everything works properly in the 'invite' action and 
through debugging i can see that my 'members' action class is 
instantiated as if it's going to be executed, but the execute() method 
is never called and struts2 gives an error about not being able to find 
the "input" result on my 'members' action.  why is this happening?


No result defined for action 
org.apache.roller.ui.authoring.struts2.Members and result input


-- Allen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Questions on action chaining and validation in struts2 - please help

2007-04-17 Thread aj123

Hi
I am trying to use action chaining in struts2 and am stuck. Any help would
be really appreciated.

Scenario - I have a page that shows a list of records and also has a form to
add a new record. When user clicks on add I call addAction and chain it to
list action to go back to list page again showing the newly added record.

My struts.xml looks something like this ->


   
   list
   
   list


   /proj/list.jsp


I have 2 issues/questions - 
a) My validation does not work if I chain actions. If I don't enter anything
in add textbox and click on Add then I get a html 404 error. If I route to
list.jsp instead of chaning to list action then I see validation messages.
But I really need to show list on that page as well. So I can not forward to
the jsp.

b) When I chain 2 actions, can I pass new params for second action? It does
not seem to work for me e.g. In following example, I can not pass foo param
to list action that is chained to add action.



list
bar

list


I would really appreciate some feedback/help here.
-- 
View this message in context: 
http://www.nabble.com/Questions-on-action-chaining-and-validation-in-struts2---please-help-tf3590988.html#a10036082
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does Struts 2 solve the action chaining problem?

2006-11-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tarek,

Tarek Nabil wrote:
> Christopher,
> 
> I really wonder if the Struts you're talking about is the one I've using
> for years now!! The Struts I know sucks big time when it comes to action
> chaining. I'm afraid I don't understand how defining two mappings, one
> with validation turned on and the other turned off, solves the first
> problem! As for the second problem, your solution still involves action
> chaining which should be avoided unless you've done something equivalent
> to what Yujun did.

I suppose I've never tried to modify the state of the request (or form
bean) such that re-interpreting it across action invocations is
relevant. I typically get information out of a form bean ASAP and then
use that for some other operation (most often database interaction).
Then I discard the form bean.

If I have to re-read the form bean, it's in the same state in which I
left it.

I guess if you store a lot of state information in your form beans, and
you mutate that information in your actions, you might end up fighting
against Struts. As it is for me, forwarding from one action to another
(that both use the same form bean) results in no problems except a
slight performance hit for re-populating the bean and validating it when
entering the second action.

I never use beans that contain anything but Strings, so no conversion
ever needs to take place. It looks like my mode of use has resulted in
me never realizing what a PITA it might be when attempting to "chain
actions" in this way.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFb2by9CaO5/Lv0PARAtveAJ9AyWu4w0x7CUOuRvxXDjoKcVKbxwCfXCvc
licIhQWz58NCiqrqaR8XwO8=
=cSgU
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >