Package net.sourceforge.stripes.exception

Examples of net.sourceforge.stripes.exception.StripesJspException


            }

            return EVAL_PAGE;
        }
        catch (IOException ioe) {
            throw new StripesJspException("Encountered an exception while trying to write to " +
                "the output from the stripes:label tag handler class, InputLabelTag.", ioe);
        }
    }
View Full Code Here


                    writer.write("\r\n//]]>");
                    writeCloseTag(writer, "script");
                }
            }
            catch (IOException ioe) {
                throw new StripesJspException("IOException while writing output in LinkTag.", ioe);
            }
        }
       
        // Only keep the type attribute between uses
        String type = getAttributes().get("type");
View Full Code Here

     *             because of a mis-spelled class name, or a class that's not an ActionBean
     */
    public void setBeanclass(Object beanclass) throws StripesJspException {
        String url = getActionBeanUrl(beanclass);
        if (url == null) {
            throw new StripesJspException(
                    "Could not determine action from 'beanclass' supplied. "
                            + "The value supplied was '"
                            + beanclass
                            + "'. Please ensure that this bean type "
                            + "exists and is in the classpath. If you are developing a page and the ActionBean "
View Full Code Here

                    clazz = ReflectUtil.findClass(n2);
                }
            }
            // If our second attempt didn't work, wrap the *original* exception
            catch (Exception e2) {
                throw new StripesJspException
                        ("Could not process class [" + this.className + "]. Attribute 'enum' on " +
                         "tag options-enumeration must be the fully qualified name of a " +
                         "class which is a java 1.5 enum.", e);
            }
        }

        if (!clazz.isEnum()) {
            throw new StripesJspException
                    ("The class name supplied, [" + this.className + "], does not appear to be " +
                     "a JDK1.5 enum class.");
        }

        Enum[] enums = clazz.getEnumConstants();

        try {
            Locale locale = getPageContext().getRequest().getLocale();
            boolean attemptToLocalizeLabels = isAttemptToLocalizeLabels();

            for (Enum item : enums) {
                Object label = null;
                String simpleName = LocalizationUtility.getSimpleName(clazz);

                if (attemptToLocalizeLabels) {
                    String packageName = clazz.getPackage() == null ? "" : clazz.getPackage().getName();

                    // Check for a localized label using class.ENUM_VALUE and package.class.ENUM_VALUE
                    label = LocalizationUtility.getLocalizedFieldName(simpleName + "." + item.name(),
                                                                      packageName,
                                                                      null,
                                                                      locale);
                }
                if (label == null) {
                    if (getLabel() != null) {
                        label = BeanUtil.getPropertyValue(getLabel(), item);
                    }
                    else {
                        label = item.toString();
                    }
                }

                Object group = null;
                if (getGroup() != null)
                    group = BeanUtil.getPropertyValue(getGroup(), item);

                addEntry(item, label, item, group);
            }
        }
        catch (ExpressionException ee) {
            throw new StripesJspException("A problem occurred generating an options-enumeration. " +
                "Most likely either the class [" + getEnum() + "] is not an enum or, [" +
                    getLabel() + "] is not a valid property of the enum.", ee);
        }

        return SKIP_BODY;
View Full Code Here

    public void setBeanclass(Object beanclass) throws StripesJspException {
        this.beanclass = beanclass;

        String url = getActionBeanUrl(beanclass);
        if (url == null) {
            throw new StripesJspException("Could not determine action from 'beanclass' supplied. " +
                "The value supplied was '" + beanclass + "'. Please ensure that this bean type " +
                "exists and is in the classpath. If you are developing a page and the ActionBean " +
                "does not yet exist, consider using the 'action' attribute instead for now.");
        }
        else {
View Full Code Here

     * doEndTag.
     */
    @Override
    public int doStartTag() throws JspException {
        if (this.actionWithoutContext == null) {
            throw new StripesJspException("The form tag attributes 'beanClass' and 'action' "
                    + "are both null. One of the two must be supplied to determine which "
                    + "action bean should handle the form submission.");
        }
        getTagStack().push(this);
        urlBuilder = new UrlBuilder(pageContext.getRequest().getLocale(), getAction(), false)
View Full Code Here

            this.fieldsPresent.clear();
            this.focusSet = false;
            this.urlBuilder = null;
        }
        catch (IOException ioe) {
            throw new StripesJspException("IOException in FormTag.doEndTag().", ioe);
        }

        return EVAL_PAGE;
    }
View Full Code Here

                }
            }
        }

        if (parent == null) {
            throw new StripesJspException
                ("InputTag of type [" + getClass().getName() + "] must be enclosed inside a " +
                 "stripes form tag. If, for some reason, you do not wish to render a complete " +
                 "form you may surround stripes input tags with <s:form partial=\"true\" ...> " +
                 "which will provide support to the input tags but not render the <form> tag.");
        }
View Full Code Here

            this.focus = false;
            if (this.syntheticId) getAttributes().remove("id");
            this.syntheticId = false;
        }
        catch (IOException ioe) {
            throw new StripesJspException("Could not write javascript focus code to jsp writer.", ioe);
        }
    }
View Full Code Here

                            .getDefinitionPage());

            if (e instanceof RuntimeException)
                throw (RuntimeException) e;
            else
                throw new StripesJspException(e);
        }
    }
View Full Code Here

TOP

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

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.