Esempio n. 1
0
 /**
  * Return the method of this action.
  *
  * <p>You can getMethod.getAnnotations() to get annotation on action method to do more things
  */
 public Method getMethod() {
   return action.getMethod();
   /*
   try {
   	return controller.getClass().getMethod(action.getMethod().getName());
   } catch (Exception e) {
   	throw new RuntimeException(e);
   }*/
 }
Esempio n. 2
0
 /** Invoke the action. */
 public void invoke() {
   if (index < inters.length) inters[index++].intercept(this);
   else if (index++ == inters.length) // index++ ensure invoke action only one time
     // try {action.getMethod().invoke(controller, NULL_ARGS);} catch (Exception e) {throw new
     // RuntimeException(e);}
     try {
       action.getMethod().invoke(controller, NULL_ARGS);
     } catch (InvocationTargetException e) {
       Throwable cause = e.getTargetException();
       if (cause instanceof RuntimeException) throw (RuntimeException) cause;
       throw new RuntimeException(e);
     } catch (RuntimeException e) {
       throw e;
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
 }