Package org.apache.struts2

Examples of org.apache.struts2.StrutsException


    /**
     * Cleans up the dispatcher instance
     */
    public void cleanupDispatcher() {
        if (dispatcher == null) {
            throw new StrutsException("Something is seriously wrong, Dispatcher is not initialized (null) ");
        } else {
            try {
                dispatcher.cleanup();
            } finally {
                ActionContext.setContext(null);
View Full Code Here


        evaluateParams();
        try {
            super.end(writer, body, false);
            mergeTemplate(writer, buildTemplateName(template, getDefaultTemplate()));
        } catch (Exception e) {
            throw new StrutsException(e);
        }
        finally {
            popComponentStack();
        }
View Full Code Here

        assert(body != null);

        try {
            writer.write(body);
        } catch (IOException e) {
            throw new StrutsException("IOError while writing the body: " + e.getMessage(), e);
        }
        if (popComponentStack) {
            popComponentStack();
        }
        return false;
View Full Code Here

     */
    protected StrutsException fieldError(String field, String errorMsg, Exception e) {
        String msg = "tag '" + getComponentName() + "', field '" + field +
                ( parameters != null && parameters.containsKey("name")?"', name '" + parameters.get("name"):"") +
                "': " + errorMsg;
        throw new StrutsException(msg, e);
    }
View Full Code Here

                urlComponent.getHttpServletRequest().setAttribute(var, result);
            } else {
                try {
                    writer.write(result);
                } catch (IOException e) {
                    throw new StrutsException("IOError: " + e.getMessage(), e);
                }
            }
        } else {
            try {
                writer.write(result);
            } catch (IOException e) {
                throw new StrutsException("IOError: " + e.getMessage(), e);
            }
        }
  }
View Full Code Here

                } finally {
                    facesContext.release();
                }
            }
        } else {
            throw new StrutsException(
                    "Unable to initialize jsf interceptors probably due missing JSF implementation libraries",
                    invocation.getProxy().getConfig());
        }
        return invocation.invoke();
    }
View Full Code Here

                // nothing to decorate
                try {
                    current = implClass.newInstance();
                } catch (InstantiationException e) {
                    log.error(e.getMessage(), e);
                    throw new StrutsException(e);
                } catch (IllegalAccessException e) {
                    log.error(e.getMessage(), e);
                    throw new StrutsException(e);
                }
            } else {
                // let's check if class supports the decorator pattern
                try {
                    Constructor delegationConstructor = implClass
                            .getConstructor(new Class[] { interfaceClass });
                    // impl class supports decorator pattern,
                    try {
                        // create new decorator wrapping current
                        current = delegationConstructor
                                .newInstance(new Object[] { current });
                    } catch (InstantiationException e) {
                        log.error(e.getMessage(), e);
                        throw new StrutsException(e);
                    } catch (IllegalAccessException e) {
                        log.error(e.getMessage(), e);
                        throw new StrutsException(e);
                    } catch (InvocationTargetException e) {
                        log.error(e.getMessage(), e);
                        throw new StrutsException(e);
                    }
                } catch (NoSuchMethodException e) {
                    // no decorator pattern support
                    try {
                        current = implClass.newInstance();
                    } catch (InstantiationException e1) {
                        log.error(e.getMessage(), e);
                        throw new StrutsException(e);
                    } catch (IllegalAccessException e1) {
                        log.error(e.getMessage(), e);
                        throw new StrutsException(e);
                    }
                }
            }
        }
View Full Code Here

    public void prepare() {
        if (writer == null) {
            try {
                writer = new FileWriter(output + "/out.dot");
            } catch (IOException e) {
                throw new StrutsException(e);
            }
        }

        StrutsConfigRetriever.setConfiguration(configDir, views.split("[, ]+"));
        DOTRenderer renderer = new DOTRenderer(writer);
View Full Code Here

   
                servletContext.setAttribute(ValidatorPlugIn.STOP_ON_ERROR_KEY + '.'
                    + prefix,
                    (this.stopOnFirstError ? Boolean.TRUE : Boolean.FALSE));
            } catch (Exception e) {
                throw new StrutsException(
                    "Cannot load a validator resource from '" + pathnames + "'", e);
            }
        }
    }
View Full Code Here

            }

            resources =  new ValidatorResources(urlArray);
        } catch (SAXException sex) {
            log.error("Skipping all validation", sex);
            throw new StrutsException("Skipping all validation because the validation files cannot be loaded", sex);
        }
        return resources;
    }
View Full Code Here

TOP

Related Classes of org.apache.struts2.StrutsException

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.