Hi all,
I've written an interceptor with a PreResultListener that gets the
action with ActionInvocation.getAction(), then casts it to an
interface ("Parseable", in this case). This lets me call a particular
method on the action just prior to the result being rendered.
The action implements Parseable and SessionAware.
When I do the cast, I get an ClassCastException for
com.opensymphony.xwork2.ActionSupport. If I take it down to one
interface (SessionAware) and cast the action to it, I still get a CCE.
What's weirder is I'm pretty sure this code worked on Struts 2.0.11.
Here's a suitably simplified version of what I'm attempting to do:
public String intercept(ActionInvocation invocation) throws Exception {
invocation.addPreResultListener(new PreResultListener() {
public void beforeResult(ActionInvocation invocation,
String resultCode) {
Action action = (Action)invocation.getAction();
if (action instanceof Parseable) {
((Parseable)action).parse();
}
}
});
Any ideas what the hell is going on here?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org