}
String controller = fullAction.substring(0, fullAction.lastIndexOf("."));
String action = fullAction.substring(fullAction.lastIndexOf(".") + 1);
controllerClass = Play.classloader.getClassIgnoreCase(controller);
if (controllerClass == null) {
throw new ActionNotFoundException(fullAction, new Exception("Controller " + controller + " not found"));
}
if (!ControllerSupport.class.isAssignableFrom(controllerClass)) {
// Try the scala way
controllerClass = Play.classloader.getClassIgnoreCase(controller + "$");
if (!ControllerSupport.class.isAssignableFrom(controllerClass)) {
throw new ActionNotFoundException(fullAction, new Exception("class " + controller + " does not extend play.mvc.Controller"));
}
}
actionMethod = Java.findActionMethod(action, controllerClass);
if (actionMethod == null) {
throw new ActionNotFoundException(fullAction, new Exception("No method public static void " + action + "() was found in class " + controller));
}
} catch (PlayException e) {
throw e;
} catch (Exception e) {
throw new ActionNotFoundException(fullAction, e);
}
return new Object[]{controllerClass, actionMethod};
}