Package org.apache.sling.scripting.jsp.jasper

Examples of org.apache.sling.scripting.jsp.jasper.JasperException


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


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

      break;
        }
    }
            } else {       
                // just in case introspection silently fails.
                throw new JasperException(
                    Localizer.getMessage("jsp.error.beans.nobeaninfo",
           beanClass.getName()));
            }
        } catch (Exception ex) {
            throw new JasperException (ex);
        }
        if (method == null) {
            if (type == null) {
    throw new JasperException(
                        Localizer.getMessage("jsp.error.beans.noproperty",
               prop,
               beanClass.getName()));
            } else {
    throw new JasperException(
        Localizer.getMessage("jsp.error.beans.nomethod.setproperty",
           prop,
           type.getName(),
           beanClass.getName()));
            }
View Full Code Here

                        break;
                    }
                }
            } else {       
                // just in case introspection silently fails.
    throw new JasperException(
                    Localizer.getMessage("jsp.error.beans.nobeaninfo",
           beanClass.getName()));
      }
  } catch (Exception ex) {
      throw new JasperException (ex);
  }
        if (method == null) {
            if (type == null) {
    throw new JasperException(
                    Localizer.getMessage("jsp.error.beans.noproperty", prop,
           beanClass.getName()));
            } else {
    throw new JasperException(
                    Localizer.getMessage("jsp.error.beans.nomethod", prop,
           beanClass.getName()));
            }
        }
View Full Code Here

  try {
      PropertyEditor pe = (PropertyEditor)propertyEditorClass.newInstance();
      pe.setAsText(attrValue);
      return pe.getValue();
  } catch (Exception ex) {
      throw new JasperException(
                Localizer.getMessage("jsp.error.beans.property.conversion",
             attrValue, attrClass.getName(), attrName,
             ex.getMessage()));
  }
    }
View Full Code Here

      } else {
    throw new IllegalArgumentException(
                    Localizer.getMessage("jsp.error.beans.propertyeditor.notregistered"));
      }
  } catch (IllegalArgumentException ex) {
      throw new JasperException(
                Localizer.getMessage("jsp.error.beans.property.conversion",
             attrValue, attrClass.getName(), attrName,
             ex.getMessage()));
  }
    }
View Full Code Here

                scanFiles(sourceDirectory);
            }

            File uriRootF = new File(uriSourceRoot);
            if (!uriRootF.exists() || !uriRootF.isDirectory()) {
                throw new JasperException("The source location '"
                    + uriSourceRoot + "' must be an existing directory");
            }

            for (String nextjsp : pages) {
                File fjsp = new File(nextjsp);
                if (!fjsp.isAbsolute()) {
                    fjsp = new File(uriRootF, nextjsp);
                }
                if (!fjsp.exists()) {
                    if (getLog().isWarnEnabled()) {
                        getLog().warn("JSP file " + fjsp + " does not exist");
                    }
                    continue;
                }
                String s = fjsp.getAbsolutePath();
                if (s.startsWith(uriSourceRoot)) {
                    nextjsp = s.substring(uriSourceRoot.length());
                }
                if (nextjsp.startsWith("." + File.separatorChar)) {
                    nextjsp = nextjsp.substring(2);
                }

                processFile(nextjsp);
            }

        } catch (JasperException je) {
            Throwable rootCause = je;
            while (rootCause instanceof JasperException
                && ((JasperException) rootCause).getRootCause() != null) {
                rootCause = ((JasperException) rootCause).getRootCause();
            }
            if (rootCause != je) {
                rootCause.printStackTrace();
            }
            throw je;

        } catch (/* IO */Exception ioe) {
            throw new JasperException(ioe);
        }
    }
View Full Code Here

        } catch (Exception e) {
            if ((e instanceof FileNotFoundException)
                && getLog().isWarnEnabled()) {
                getLog().warn("Missing file: " + e.getMessage());
            }
            throw new JasperException(e);
        } finally {
            if (originalClassLoader != null) {
                Thread.currentThread().setContextClassLoader(
                    originalClassLoader);
            }
View Full Code Here

            DocumentBuilder builder = factory.newDocumentBuilder();
            builder.setEntityResolver(entityResolver);
            builder.setErrorHandler(errorHandler);
            document = builder.parse(is);
  } catch (ParserConfigurationException ex) {
            throw new JasperException
                (Localizer.getMessage("jsp.error.parse.xml", uri), ex);
  } catch (SAXParseException ex) {
            throw new JasperException
                (Localizer.getMessage("jsp.error.parse.xml.line",
              uri,
              Integer.toString(ex.getLineNumber()),
              Integer.toString(ex.getColumnNumber())),
     ex);
  } catch (SAXException sx) {
            throw new JasperException
                (Localizer.getMessage("jsp.error.parse.xml", uri), sx);
        } catch (IOException io) {
            throw new JasperException
                (Localizer.getMessage("jsp.error.parse.xml", uri), io);
  }

        // Convert the resulting document to a graph of TreeNodes
        return (convert(null, document.getDocumentElement()));
View Full Code Here

        throws JasperException {
        Class clazz = null;
        try {
            clazz = loader.loadClass(beanTypes.get(bean));
        } catch (ClassNotFoundException ex) {
            throw new JasperException (ex);
        }
        return clazz;
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.scripting.jsp.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.