Hello fellow stripers -

I want to write an exception handler that can take hints from the
action bean about how to handle errors based on annotations in the
action bean.    Eg:

class MyAction {
  @Foo
  public Resolution doStuff() {
      ...
  }
}

class MyExceptionHandler implements ExceptionHandler {
  public void handle(...) {
     Class actionClass = ???;  <=== how to get this???
     ActionBeanContext ctx = ...;   // I know how to get this
     Method m = actionClass.getMethod(ctx.getEventName());
     if(m.isAnnotationPresent(Foo.class)) {
         ... // <== do something special!
     }
  }
}

However I can't figure out in the exception handler which action
caused the error.  (I realize it might be more complicated, perhaps
with jsps or something else in between).    My only idea at the moment
is to iterate up the stack trace and look for anything that might be
an action bean.

Any ideas how I can do this?

Cheers,

Simon.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to