Examples of StripesRuntimeException


Examples of net.sourceforge.stripes.exception.StripesRuntimeException

        }
        else if (eventParams.size() == 1) {
            return eventParams.get(0);
        }
        else {
            throw new StripesRuntimeException("Multiple event parameters " + eventParams
                    + " are present in this request. Only one event parameter may be specified "
                    + "per request. Otherwise, Stripes would be unable to determine which event "
                    + "to execute.");
        }
    }
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                      "ActionBean, using the configuration parameter '", PACKAGES,  "'.");
        }

        String packages = bootstrap.getProperty(PACKAGES);
        if (packages == null) {
            throw new StripesRuntimeException(
                "You must supply a value for the configuration parameter '" + PACKAGES + "'. The " +
                "value should be a list of one or more package roots (comma separated) that are " +
                "to be scanned for ActionBean implementations. The packages specified and all " +
                "subpackages are examined for implementations of ActionBean."
            );
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                }
                request.setAttribute(entry.getKey(), value);
            }
        }
        catch (InterruptedException e) {
            throw new StripesRuntimeException(e);
        }
        finally {
            // Make sure the semaphore permit gets released
            if (acquired)
                getSemaphore().release();
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

        Wizard wizard = bean.getClass().getAnnotation(Wizard.class);
        boolean isWizard = wizard != null;

        if (fieldsPresent == null || "".equals(fieldsPresent)) {
            if (isWizard && !CollectionUtil.contains(wizard.startEvents(), ctx.getEventName())) {
                throw new StripesRuntimeException(
                        "Submission of a wizard form in Stripes absolutely requires that "
                                + "the hidden field Stripes writes containing the names of the fields "
                                + "present on the form is present and encrypted (as Stripes write it). "
                                + "This is necessary to prevent a user from spoofing the system and "
                                + "getting around any security/data checks.");
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                Class<?> beanType = m.getParameterTypes()[0];
                Object managedBean = findSpringBean(ctx, name, beanType, !nameSupplied);
                m.invoke(bean, managedBean);
            }
            catch (Exception e) {
                throw new StripesRuntimeException("Exception while trying to lookup and inject " +
                    "a Spring bean into a bean of type " + bean.getClass().getSimpleName() +
                    " using method " + m.toString(), e);
            }
        }

        // And then inject any properties that are annotated
        for (Field f : getFields(bean.getClass())) {
            try {
                SpringBean springBean = f.getAnnotation(SpringBean.class);
                boolean nameSupplied = !"".equals(springBean.value());
                String name = nameSupplied ? springBean.value() : f.getName();
                Object managedBean = findSpringBean(ctx, name, f.getType(), !nameSupplied);
                f.set(bean, managedBean);
            }
            catch (Exception e) {
                throw new StripesRuntimeException("Exception while trying to lookup and inject " +
                    "a Spring bean into a bean of type " + bean.getClass().getSimpleName() +
                    " using field access on field " + f.toString(), e);
            }
        }
    }
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                    if (!method.isAccessible()) {
                        try {
                            method.setAccessible(true);
                        }
                        catch (SecurityException se) {
                            throw new StripesRuntimeException(
                                "Method " + clazz.getName() + "." + method.getName() + "is marked " +
                                "with @SpringBean and is not public. An attempt to call " +
                                "setAccessible(true) resulted in a SecurityException. Please " +
                                "either make the method public or modify your JVM security " +
                                "policy to allow Stripes to setAccessible(true).", se);
                        }
                    }

                    // Ensure the method has only the one parameter
                    if (method.getParameterTypes().length != 1) {
                        throw new StripesRuntimeException(
                            "A method marked with @SpringBean must have exactly one parameter: " +
                            "the bean to be injected. Method [" + method.toGenericString() + "] has " +
                            method.getParameterTypes().length + " parameters."
                        );
                    }
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                    // If the field isn't public, try to make it accessible
                    try {
                        field.setAccessible(true);
                    }
                    catch (SecurityException se) {
                        throw new StripesRuntimeException(
                            "Field " + clazz.getName() + "." + field.getName() + "is marked " +
                            "with @SpringBean and is not public. An attempt to call " +
                            "setAccessible(true) resulted in a SecurityException. Please " +
                            "either make the field public, annotate a public setter instead " +
                            "or modify your JVM security policy to allow Stripes to " +
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

        }

        // If we got here then we didn't find a bean yet, try by type
        String[] beanNames = ctx.getBeanNamesForType(type);
        if (beanNames.length == 0) {
            throw new StripesRuntimeException(
                "Unable to find SpringBean with name [" + name + "] or type [" +
                type.getName() + "] in the Spring application context.");
        }
        else if (beanNames.length > 1) {
            throw new StripesRuntimeException(
                "Unable to find SpringBean with name [" + name + "] or unique bean with type [" +
                type.getName() + "] in the Spring application context. Found " + beanNames.length +
                "beans of matching type.");
        }
        else {
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                this.validatePattern = globToPattern(getValidatedProperties(beanClass));
            }
        }
        catch (Exception e) {
            log.error(e, "%%% Failure instantiating ", getClass().getName());
            StripesRuntimeException sre = new StripesRuntimeException(e.getMessage(), e);
            sre.setStackTrace(e.getStackTrace());
            throw sre;
        }
    }
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

        try {
            String encoding = request.getCharacterEncoding();
            uri = URLDecoder.decode(uri, encoding != null ? encoding : "UTF-8");
        }
        catch (UnsupportedEncodingException e) {
            throw new StripesRuntimeException(e);
        }

        return uri;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.