code: private ViewDispatcher getViewDispatcher(Activity activity) throws ViewDispatcherException {
          if (dispatchRule.getViewDispatcher() != null) {
              return dispatchRule.getViewDispatcher();
          }
  
          try {
              String dispatcherName;
              if (dispatchRule.getDispatcherName() != null) {
                  dispatcherName = dispatchRule.getDispatcherName();
              } else {
                  dispatcherName = activity.getSetting(ViewDispatcher.VIEW_DISPATCHER_SETTING_NAME);
                  if (dispatcherName == null) {
                      throw new IllegalArgumentException("The settings name '" + ViewDispatcher.VIEW_DISPATCHER_SETTING_NAME +
                              "' has not been specified in the default response rule");
                  }
              }
  
              ViewDispatcher viewDispatcher = cache.get(dispatcherName);
              if (viewDispatcher == null) {
                  if (dispatcherName.startsWith(BeanRule.CLASS_DIRECTIVE_PREFIX)) {
                      String dispatcherClassName = dispatcherName.substring(BeanRule.CLASS_DIRECTIVE_PREFIX.length());
                      Class<?> dispatcherClass = activity.getEnvironment().getClassLoader().loadClass(dispatcherClassName);
                      viewDispatcher = (ViewDispatcher)activity.getBean(dispatcherClass);
                  } else {
                      viewDispatcher = activity.getBean(dispatcherName);
                  }
                  if (viewDispatcher == null) {
                      throw new IllegalArgumentException("No bean named '" + dispatcherName + "' is defined");
                  }
                  if (viewDispatcher.isSingleton()) {
                      ViewDispatcher existing = cache.putIfAbsent(dispatcherName, viewDispatcher);
                      if (existing != null) {
                          viewDispatcher = existing;
                      } else {
                          if (log.isDebugEnabled()) {
                              log.debug("Caching " + viewDispatcher);
                          }
                      }
                  }
              }
              return viewDispatcher;
          } catch(Exception e) {
              throw new ViewDispatcherException("Unable to determine ViewDispatcher", e);
          }
      }
docs: Determine the view dispatcher.
  
  @param activity the current Activity
  @throws ViewDispatcherException if ViewDispatcher can not be determined