Package org.apache.struts2.jasper

Examples of org.apache.struts2.jasper.JasperException


            }

            if (jspFrame == null) {
                // If we couldn't find a frame in the stack trace corresponding
                // to the generated servlet class, we can't really add anything
                return new JasperException(ex);
            } else {
                int javaLineNumber = jspFrame.getLineNumber();
                JavacErrorDetail detail = ErrorDispatcher.createJavacError(
                        jspFrame.getMethodName(),
                        this.ctxt.getCompiler().getPageNodes(),
                        null,
                        javaLineNumber,
                        this.ctxt);

                // If the line number is less than one we couldn't find out
                // where in the JSP things went wrong
                int jspLineNumber = detail.getJspBeginLineNumber();
                if (jspLineNumber < 1) {
                    throw new JasperException(ex);
                }

                return new JasperException("Exception in JSP: " +
                        detail.getJspFileName() + ":" + jspLineNumber + "\n\n" +
                        detail.getJspExtract() + "\n\nStacktrace:", ex);
            }
        } catch (Exception je) {
            // If anything goes wrong, just revert to the original behaviour
            if (ex instanceof JasperException) {
                return (JasperException) ex;
            } else {
                return new JasperException(ex);
            }
        }
    }
View Full Code Here


            } else {
                return getValueFromPropertyEditorManager(
                        t, propertyName, s);
            }
        } catch (Exception ex) {
            throw new JasperException(ex);
        }
    }
View Full Code Here

                }
            }
            if (method != null) {
                if (type.isArray()) {
                    if (request == null) {
                        throw new JasperException(
                                Localizer.getMessage("jsp.error.beans.setproperty.noindexset"));
                    }
                    Class t = type.getComponentType();
                    String[] values = request.getParameterValues(param);
                    //XXX Please check.
                    if (values == null) return;
                    if (t.equals(String.class)) {
                        method.invoke(bean, new Object[]{values});
                    } else {
                        createTypedArray(prop, bean, method, values, t,
                                propertyEditorClass);
                    }
                } else {
                    if (value == null || (param != null && value.equals(""))) return;
                    Object oval = convert(prop, value, type, propertyEditorClass);
                    if (oval != null)
                        method.invoke(bean, new Object[]{oval});
                }
            }
        } catch (Exception ex) {
            throw new JasperException(ex);
        }
        if (!ignoreMethodNF && (method == null)) {
            if (type == null) {
                throw new JasperException(
                        Localizer.getMessage("jsp.error.beans.noproperty",
                                prop,
                                bean.getClass().getName()));
            } else {
                throw new JasperException(
                        Localizer.getMessage("jsp.error.beans.nomethod.setproperty",
                                prop,
                                type.getName(),
                                bean.getClass().getName()));
            }
View Full Code Here

                                    t, propertyName, values[i]);
                }
                method.invoke(bean, new Object[]{tmpval});
            }
        } catch (Exception ex) {
            throw new JasperException("error in invoking method", ex);
        }
    }
View Full Code Here

    // __begin lookupReadMethodMethod
    public static Object handleGetProperty(Object o, String prop)
            throws JasperException {
        if (o == null) {
            throw new JasperException(
                    Localizer.getMessage("jsp.error.beans.nullbean"));
        }
        Object value = null;
        try {
            Method method = getReadMethod(o.getClass(), prop);
            value = method.invoke(o, null);
        } catch (Exception ex) {
            throw new JasperException(ex);
        }
        return value;
    }
View Full Code Here

                            pageContext,
                            functionMapper,
                            false)
            });
        } catch (Exception ex) {
            throw new JasperException(ex);
        }
    }
View Full Code Here

            throws JasperException {
        try {
            Method method = getWriteMethod(bean.getClass(), prop);
            method.invoke(bean, new Object[]{value});
        } catch (Exception ex) {
            throw new JasperException(ex);
        }
    }
View Full Code Here

            throws JasperException {
        try {
            Method method = getWriteMethod(bean.getClass(), prop);
            method.invoke(bean, new Object[]{new Integer(value)});
        } catch (Exception ex) {
            throw new JasperException(ex);
        }
    }
View Full Code Here

            throws JasperException {
        try {
            Method method = getWriteMethod(bean.getClass(), prop);
            method.invoke(bean, new Object[]{new Short(value)});
        } catch (Exception ex) {
            throw new JasperException(ex);
        }
    }
View Full Code Here

            throws JasperException {
        try {
            Method method = getWriteMethod(bean.getClass(), prop);
            method.invoke(bean, new Object[]{new Long(value)});
        } catch (Exception ex) {
            throw new JasperException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.struts2.jasper.JasperException

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.