Package net.sourceforge.stripes.exception

Examples of net.sourceforge.stripes.exception.StripesRuntimeException


        try {
            TypeConverterFactory factory = StripesFilter.getConfiguration().getTypeConverterFactory();
            return factory.getTypeConverter(targetType, this.locale);
        }
        catch (Exception e) {
            throw new StripesRuntimeException(
                    "You are using the OneToManyTypeConverter to convert a String to a List of " +
                            "items for which there is no registered converter! Please check that the " +
                            "TypeConverterFactory knows how to make a converter for: " +
                            targetType, e
            );
View Full Code Here


        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

            }
            else if (lcFormatType.equals("time")) {
                format = DateFormat.getTimeInstance(namedPatterns.get(lcFormatString), locale);
            }
            else {
                throw new StripesRuntimeException("Invalid formatType for Date: " + formatType +
                ". Allowed types are 'date', 'time' and 'datetime'.");
            }
        }
        else {
            format = new SimpleDateFormat(formatPattern, locale);
View Full Code Here

                    log.warn("Error closing input stream", e);
                }
            }
        }
        else {
            throw new StripesRuntimeException("A StreamingResolution was constructed without " +
                    "supplying a Reader or InputStream, but stream() was not overridden. Please " +
                    "either supply a source of streaming data, or override the stream() method.");
        }
    }
View Full Code Here

                ValidationMetadata validate = getValidationMetadata();
                if (validate != null && validate.encrypted())
                    formatted = CryptoUtil.encrypt(formatted);
            }
            catch (JspException e) {
                throw new StripesRuntimeException(e);
            }
        }

        return formatted;
    }
View Full Code Here

        // Initialize the layout context and related fields
        context = LayoutContext.lookup(pageContext);

        if (context == null) {
            throw new StripesRuntimeException("A component tag named \"" + getName() + "\" in "
                    + getCurrentPagePath() + " was unable to find a layout context.");
        }

        log.trace("Component ", getName() + " has context ", context.getRenderPage(), " -> ",
                context.getDefinitionPage());
View Full Code Here

                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

            String contents = ((StringWriter) writers.poll()).toString();
            log.trace("Closed buffer: \"", contents, "\"");
            return contents;
        }
        else {
            throw new StripesRuntimeException(
                    "Attempt to close a buffer without having first called openBuffer(..)!");
        }
    }
View Full Code Here

        }
        else if (out instanceof StringWriter) {
            ((StringWriter) out).getBuffer().setLength(0);
        }
        else {
            throw new StripesRuntimeException("How did I get a writer of type "
                    + out.getClass().getName() + "??");
        }
    }
View Full Code Here

            return wrapper;
        }
        catch (IOException ioe) { throw ioe; }
        catch (FileUploadLimitExceededException fulee) { throw fulee; }
        catch (Exception e) {
            throw new StripesRuntimeException
                    ("Could not construct a MultipartWrapper for the current request.", e);
        }
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.exception.StripesRuntimeException

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.