public DefaultExceptionHandlerConfig(ExceptionConfig exceptionConfig) { this.exceptionConfig = exceptionConfig; try { Class handlerClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getHandler()); exceptionHandler = (ExceptionHandler)handlerClass.newInstance(); exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
public DefaultExceptionHandlerConfig(ExceptionConfig exceptionConfig) { this.exceptionConfig = exceptionConfig; try { Class handlerClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getHandler()); exceptionHandler = (ExceptionHandler)handlerClass.newInstance(); exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
public DefaultExceptionHandlerConfig(ExceptionConfig exceptionConfig) { this.exceptionConfig = exceptionConfig; try { Class handlerClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getHandler()); exceptionHandler = (ExceptionHandler)handlerClass.newInstance(); exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
ExceptionHandler handler = (ExceptionHandler) RequestUtils.applicationInstance(config .getHandler());
RequestUtils.applicationInstance(config.getHandler()); return (handler.execute(exception, config, mapping, form, request, response));
protected ForwardConfig handle(ActionContext context, Exception exception, ExceptionConfig exceptionConfig, ActionConfig actionConfig, ModuleConfig moduleConfig) throws Exception { // Look up the remaining properties needed for this handler ServletActionContext sacontext = (ServletActionContext) context; ActionForm actionForm = (ActionForm) sacontext.getActionForm(); HttpServletRequest request = sacontext.getRequest(); HttpServletResponse response = sacontext.getResponse(); // Handle this exception org.apache.struts.action.ExceptionHandler handler = (org.apache.struts.action.ExceptionHandler) ClassUtils .getApplicationInstance(exceptionConfig.getHandler()); return (handler.execute(exception, exceptionConfig, (ActionMapping) actionConfig, actionForm, request, response)); } }
if (getHandler().equals("org.apache.struts.action.ExceptionHandler")) { setHandler(config.getHandler());