Examples of StripesRuntimeException


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

        Configuration configuration = StripesFilter.getConfiguration();
        if (configuration != null) {
            this.baseUrl = configuration.getActionResolver().getUrlBinding(beanType);
        }
        else {
            throw new StripesRuntimeException("Unable to lookup URL binding for ActionBean class "
                    + "because there is no Configuration object available.");
        }
    }
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                }
            }
        }

        if (configuration == null) {
            StripesRuntimeException sre = new StripesRuntimeException(
                    "Something is trying to access the current Stripes configuration but the " +
                    "current request was never routed through the StripesFilter! As a result " +
                    "the appropriate Configuration object cannot be located. Please take a look " +
                    "at the exact URL in your browser's address bar and ensure that any " +
                    "requests to that URL will be filtered through the StripesFilter according " +
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

            }

            writer.append(rootVariableName).append(";\n");
        }
        catch (Exception e) {
            throw new StripesRuntimeException("Could not build JavaScript for object. An " +
                    "exception was thrown while trying to convert a property from Java to " +
                    "JavaScript. The object being converted is: " + this.rootObject, e);
        }

    }
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                className = clazz.getName();
                log.info("Class implementing/extending ", targetType.getSimpleName(),
                        " found via auto-discovery: ", className);
            }
            else if (classes.size() > 1) {
                throw new StripesRuntimeException(StringUtil.combineParts(
                        "Found too many classes implementing/extending ", targetType
                                .getSimpleName(), ": ", classes));
            }
        }
View Full Code Here

Examples of net.sourceforge.stripes.exception.StripesRuntimeException

                className = className.trim();
                try {
                    classes.add(ReflectUtil.findClass(className));
                }
                catch (ClassNotFoundException e) {
                    throw new StripesRuntimeException("Could not find class [" + className
                            + "] specified by the configuration parameter [" + paramName
                            + "]. This value must contain fully qualified class names separated "
                            + " by commas.");
                }
            }
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

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

                                buf.append(" and ");
                            if (hasNested)
                                buf.append("@ValidateNestedProperties");
                            buf.append('\n');
                        }
                        throw new StripesRuntimeException(buf.toString());
                    }

                    // after the conflict check, stop processing fields we've already seen
                    if (seen.contains(propertyName))
                        continue;

                    // get the @Validate and/or @ValidateNestedProperties
                    Validate simple;
                    ValidateNestedProperties nested;
                    if (onAccessor) {
                        simple = accessor.getAnnotation(Validate.class);
                        nested = accessor.getAnnotation(ValidateNestedProperties.class);
                        seen.add(propertyName);
                    }
                    else if (onMutator) {
                        simple = mutator.getAnnotation(Validate.class);
                        nested = mutator.getAnnotation(ValidateNestedProperties.class);
                        seen.add(propertyName);
                    }
                    else if (onField) {
                        simple = field.getAnnotation(Validate.class);
                        nested = field.getAnnotation(ValidateNestedProperties.class);
                        seen.add(propertyName);
                    }
                    else {
                        simple = null;
                        nested = null;
                    }

                    // add to allow list if @Validate present
                    if (simple != null) {
                        if (simple.field() == null || "".equals(simple.field())) {
                            meta.put(propertyName, new ValidationMetadata(propertyName, simple));
                        }
                        else {
                            log.warn("Field name present in @Validate but should be omitted: ",
                                    clazz, ", property ", propertyName, ", given field name ",
                                    simple.field());
                        }
                    }

                    // add all sub-properties referenced in @ValidateNestedProperties
                    if (nested != null) {
                        Validate[] validates = nested.value();
                        if (validates != null) {
                            for (Validate validate : validates) {
                                if (validate.field() != null && !"".equals(validate.field())) {
                                    String fullName = propertyName + '.' + validate.field();
                                    if (meta.containsKey(fullName)) {
                                        log.warn("More than one nested @Validate with same field name: "
                                            + validate.field() + " on property " + propertyName);
                                    }
                                    meta.put(fullName, new ValidationMetadata(fullName, validate));
                                }
                                else {
                                    log.warn("Field name missing from nested @Validate: ", clazz,
                                            ", property ", propertyName);
                                }
                            }
                        }
                    }
                }
            }
        }
        catch (RuntimeException e) {
            log.error(e, "Failure checking @Validate annotations ", getClass().getName());
            throw e;
        }
        catch (Exception e) {
            log.error(e, "Failure checking @Validate annotations ", getClass().getName());
            StripesRuntimeException sre = new StripesRuntimeException(e.getMessage(), e);
            sre.setStackTrace(e.getStackTrace());
            throw sre;
        }

        // Print out a pretty debug message showing what validations got configured
        StringBuilder builder = new StringBuilder(128);
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
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.