Package javax.faces

Examples of javax.faces.FacesException


                return object;
            }
            catch (Exception e)
            {
                pendingException = e;
                throw new FacesException(e);
            }
            finally
            {
                if (s != null)
                {
                    try
                    {
                        s.close();
                    }
                    catch (IOException e)
                    {
                        // If a previous exception is thrown
                        // ignore this, but if not, wrap it in a
                        // FacesException and throw it. In this way
                        // we preserve the original semantic of this
                        // method, but we handle correctly the case
                        // when we close a stream. Obviously, the
                        // information about this exception is lost,
                        // but note that the interesting information
                        // is always on pendingException, since we
                        // only do a readObject() on the outer try block.
                        if (pendingException == null)
                        {
                            throw new FacesException(e);
                        }                       
                    }
                    finally
                    {
                        s = null;
View Full Code Here


            return cipher.doFinal(data);
        }
        catch (Exception e)
        {
            throw new FacesException(e);
        }
   
    }
View Full Code Here

    try {
      input = context.getResourceAsStream(configPath);
      if (input != null) {
        digester.parse(input);
      } else {
        throw new FacesException(
            "No config file found: '" + configPath + "'. Tobago can't run without configuration.");
      }
    } finally {
      IOUtils.closeQuietly(input);
    }
View Full Code Here

            }

        }
        catch (Exception e)
        {
            throw new FacesException(e);
        }
        return component;

    }
View Full Code Here

        XMLBody xmlBody = new XMLBody();
        try {
            xmlBody.loadXML(context.getExternalContext().getResourceAsStream(viewId), false);
            return PRELUDE + xmlBody.getContent(getXpath()) + TAIL;
        } catch (ParsingException e) {
            throw new FacesException(e);
        }
    }
View Full Code Here

                        Matcher titleMatcher = titlePattern.matcher(headString);
                        if (titleMatcher.find() && titleMatcher.group(1).length() > 0) {
                            title = titleMatcher.group(1);
                        }
                    } catch (IOException e) {
                        throw new FacesException("can't read directory content", e);
                    } finally {
                        try {
                            pageInputStream.close();
                        } catch (IOException e) {
                            // ignore it.
View Full Code Here

            try {
                context = JAXBContext.newInstance(CDsHolder.class);
                CDsHolder cdsHolder = (CDsHolder) context.createUnmarshaller().unmarshal(resource);
                cdsList = cdsHolder.getCds();
            } catch (JAXBException e) {
                throw new FacesException(e.getMessage(), e);
            }
        }

        return cdsList;
    }
View Full Code Here

    @Override
    public InputStream getInputStream() throws IOException {
        try {
            return new ByteArrayInputStream(state.toString().getBytes("US-ASCII"));
        } catch (UnsupportedEncodingException e) {
            throw new FacesException(e.getMessage(), e);
        }
    }
View Full Code Here

        try {
            appendScript(builder);
            return builder.toString();
        } catch (IOException e) {
            throw new FacesException(e.getMessage(), e);
        }
    }
View Full Code Here

            PropertyDescriptor[] propertyDescriptors;

            try {
                propertyDescriptors = PropertyUtils.getPropertyDescriptors(obj);
            } catch (Exception e) {
                throw new FacesException("Error in conversion Java Object to JavaScript", e);
            }

            boolean ignorePropertyReadException = obj.getClass().getName().startsWith("java.sql.")
                || obj.getClass().equals(SimpleTimeZone.class);
            boolean first = true;

            for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
                String key = propertyDescriptor.getName();

                if ("class".equals(key)) {
                    continue;
                }

                Object propertyValue;

                try {
                    propertyValue = PropertyUtils.readPropertyValue(obj, propertyDescriptor);
                } catch (Exception e) {
                    if (!ignorePropertyReadException) {
                        throw new FacesException("Error in conversion Java Object to JavaScript", e);
                    } else {
                        continue;
                    }
                }
View Full Code Here

TOP

Related Classes of javax.faces.FacesException

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.