Package org.g4studio.core.mvc.xstruts.config

Examples of org.g4studio.core.mvc.xstruts.config.ExceptionConfig


   *            Exception class for which to find a handler
   * @since Struts 1.3.0
   */
  public ExceptionConfig findException(Class type) {
    // Check through the entire superclass hierarchy as needed
    ExceptionConfig config = null;

    while (true) {
      // Check for a locally defined handler
      String name = type.getName();

View Full Code Here


    // Process exception config extensions.
    ExceptionConfig[] exceptions = config.findExceptionConfigs();

    for (int i = 0; i < exceptions.length; i++) {
      ExceptionConfig exception = exceptions[i];

      processExceptionExtension(exception, config);
    }

    for (int i = 0; i < exceptions.length; i++) {
      ExceptionConfig exception = exceptions[i];

      // Verify that required fields are all present for the config
      if (exception.getKey() == null) {
        handleValueRequiredException("key", exception.getType(), "global exception config");
      }
    }
  }
View Full Code Here

      // Nothing to do, then
      return exceptionConfig;
    }

    // Make sure that this config is of the right class
    ExceptionConfig baseConfig = moduleConfig.findExceptionConfig(ancestor);

    if (baseConfig == null) {
      throw new UnavailableException("Unable to find " + "exception config '" + ancestor + "' to extend.");
    }

    // Was our config's class overridden already?
    if (exceptionConfig.getClass().equals(ExceptionConfig.class)) {
      // Ensure that our config is using the correct class
      if (!baseConfig.getClass().equals(exceptionConfig.getClass())) {
        // Replace the config with an instance of the correct class
        ExceptionConfig newExceptionConfig = null;
        String baseConfigClassName = baseConfig.getClass().getName();

        try {
          newExceptionConfig = (ExceptionConfig) RequestUtils.applicationInstance(baseConfigClassName);
View Full Code Here

      // ... and the exception configs
      ExceptionConfig[] exceptions = actionConfig.findExceptionConfigs();

      for (int j = 0; j < exceptions.length; j++) {
        ExceptionConfig exception = exceptions[j];

        if (exception.getKey() == null) {
          handleValueRequiredException("key", exception.getType(), "action exception config");
        }
      }
    }
  }
View Full Code Here

      return (true);
    }

    // Look up the local or global exception handler configuration
    ExceptionConfig exceptionConfig = null;
    ActionConfig actionConfig = actionCtx.getActionConfig();
    ModuleConfig moduleConfig = actionCtx.getModuleConfig();

    if (actionConfig != null) {
      if (LOG.isDebugEnabled()) {
View Full Code Here

   *             if a servlet exception occurs
   */
  protected ActionForward processException(HttpServletRequest request, HttpServletResponse response,
      Exception exception, ActionForm form, ActionMapping mapping) throws IOException, ServletException {
    // Is there a defined handler for this exception?
    ExceptionConfig config = mapping.findException(exception.getClass());

    if (config == null) {
      log.warn(getInternal().getMessage("unhandledException", exception.getClass()));

      if (exception instanceof IOException) {
        throw (IOException) exception;
      } else if (exception instanceof ServletException) {
        throw (ServletException) exception;
      } else {
        throw new ServletException(exception);
      }
    }

    // Use the configured exception handling
    try {
      ExceptionHandler handler = (ExceptionHandler) RequestUtils.applicationInstance(config.getHandler());

      return (handler.execute(exception, config, mapping, form, request, response));
    } catch (Exception e) {
      throw new ServletException(e);
    }
View Full Code Here

TOP

Related Classes of org.g4studio.core.mvc.xstruts.config.ExceptionConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.