2

I am trying to do a redirectAction to another class, and to invoke a specific method in that class.
Basically, when the user hits an "Edit" link in a cell in a table, we get that object and put it into the Session, and then invoke the Editor class, calling the method which retrieves that object from the Session so it can be displayed in the editor.

This is the way my predecessors wrote the system long ago, and I'd prefer to make as few structural changes as possible.

Upgrading to 2.5 breaks all that.
We've narrowed it down to the method parameter:

<result name="editSingle" type="redirectAction">
    <param name="actionName">productEdit</param>
    <param name="method">getFromSession</param>
</result>

When we run this, we get the

"There is no Action mapped..."

message.
When we comment out the <param name="method"> line, it no longer fails, but obviously it never gets to the method we are no longer specifying. The docs for the redirectAction list a few parameters, but method is not among them. So my questions, I suppose, are twofold:

1) Did this really get removed somewhere in the 2.1 -> 2.5 migration journey?

2) How are people handling this removal? We can't be the only ones who've run into this.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Tom
  • 51
  • 1
  • 3
  • It may be [this](issues.apache.org/jira/browse/WW-4540), e.g., https://cwiki.apache.org/confluence/display/WW/Action+Configuration#ActionConfiguration-StrictMethodInvocation. Try that and see if that fixes it--it's not clear to me if this work includes XML-defined methods. – Dave Newton Jan 24 '17 at 21:05
  • @DaveNewton, thanks for the suggestion, but it's not the solution. I added the method in but the result was the same. In the Docs, the redirectAction page says that the parameters are these: actionName, namespace, suppressEmptyParameters, parse, anchor. No mention of "method" anywhere, so I suspect I can't specify method at all. – Tom Jan 25 '17 at 00:42

1 Answers1

0

1) Did this really get removed somewhere in the 2.1 -> 2.5 migration journey?

No, I compared Struts 2.5 ServletActionRedirectResult.java with Struts 2.1 ServletActionRedirectResult.java and both are same about parameter method!

Yasser Zamani
  • 2,380
  • 21
  • 18