Package net.sourceforge.stripes.exception

Examples of net.sourceforge.stripes.exception.StripesJspException


                }
            }
        }

        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

                }
                addEntry(item, label, value, group);
            }
        }
        catch (ExpressionException ee) {
            throw new StripesJspException("A problem occurred generating an options-collection. " +
                "Most likely either [" + labelProperty + "] or ["+ valueProperty + "] is not a " +
                "valid property of the beans in the collection: " + this.collection, ee);
        }

        return SKIP_BODY;
View Full Code Here

                /** Catch whatever comes back out of the doCatch() method and deal with it */
                try { tag.doCatch(t); }
                catch (Throwable t2) {
                    if (t2 instanceof JspException) throw (JspException) t2;
                    if (t2 instanceof RuntimeException) throw (RuntimeException) t2;
                    else throw new StripesJspException(t2);
                }
            }
            finally {
                tag.doFinally();
            }
View Full Code Here

        try {
            return (R) this.pageContext.getExpressionEvaluator().
                evaluate(expression, resultType, this.pageContext.getVariableResolver(), null);
        }
        catch (javax.servlet.jsp.el.ELException ele) {
            throw new StripesJspException
                ("Could not evaluate EL expression  [" + expression + "] with result type [" +
                    resultType.getName() + "] in tag class of type: " + getClass().getName(), ele);
        }
    }
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

    public LayoutContext getContext() throws StripesJspException {
        if (context == null) {
            context = LayoutContext.lookup(pageContext);

            if (context == null) {
                throw new StripesJspException("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

                            .getDefinitionPage());

            if (e instanceof RuntimeException)
                throw (RuntimeException) e;
            else
                throw new StripesJspException(e);
        }
    }
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();

            for (Enum item : enums) {
                Object label = null;
                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(clazz.getSimpleName() + "." + 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

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.