Package com.ocpsoft.pretty

Examples of com.ocpsoft.pretty.PrettyException


         webXmlParser.parse(servletContext);
         return dynaview.buildDynaViewId(webXmlParser.getFacesMapping());
      }
      catch (Exception e)
      {
         throw new PrettyException("Could not retrieve DynaViewId.", e);
      }
   }
View Full Code Here


      if (m.hasParent() && !seen.contains(m))
      {
         UrlMapping parent = config.getMappingById(m.getParentId());
         if (parent == null)
         {
            throw new PrettyException("Error when building configuration for URL-mapping [" + m.getId() + ":"
                  + m.getPattern() + "] - the requested parentId [" + m.getParentId() + "] does not exist in the configuration.");
         }
         if (parent.hasParent())
         {
            createAncestry(config, parent);
View Full Code Here

         {
            configParser.parse(builder, is);
         }
         catch (Exception e)
         {
            throw new PrettyException("Failed to parse PrettyFaces configuration from " + configFilePath, e);
         }
         finally
         {
            try
            {
View Full Code Here

                     {
                        configParser.parse(builder, is);
                     }
                     catch (SAXException e)
                     {
                        throw new PrettyException("Failed to parse PrettyFaces configuration from URL:" + url, e);
                     }
                  }
                  finally
                  {
                     if (is != null)
                     {
                        is.close();
                     }
                  }
               }
            }
         }
      }
      catch (Exception e)
      {
         throw new PrettyException("Could not get references to PrettyFaces ClassLoader-configuration elements.", e);
      }
      return builder.build();
   }
View Full Code Here

               String redirectUrl = externalContext.encodeRedirectURL(url, null);
               externalContext.redirect(redirectUrl);
            }
            else
            {
               throw new PrettyException("PrettyFaces: Invalid mapping id supplied to navigation handler: " + action);
            }
            return true;
         }
      }
      catch (IOException e)
View Full Code Here

         HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
         response.sendError(HttpServletResponse.SC_NOT_FOUND);
      }
      catch (IOException e)
      {
         throw new PrettyException(e);
      }
   }
View Full Code Here

               inboundUrl = inboundUrl.substring(regionEnd - 1);
            }
            else
            {
               throw new PrettyException("Error parsing url: <" + url
                           + ">, a parameter did not match compiled segment in pattern: " + originalPattern);
            }
         }
      }
      else
View Full Code Here

         /*
          * Assert that we have the proper number of parameters.
          */
         if (getParameterCount() != parameters.length)
         {
            throw new PrettyException("Invalid number of path parameters supplied for pattern: " + originalPattern
                     + ", expected <" + getParameterCount() + ">, but got <" + parameters.length + ">");
         }

         /*
          * Build the result URL
          */
         int paramIndex = 0;
         List<String> resultSegments = new ArrayList<String>();
         for (Segment segment : pathSegments)
         {
            String template = segment.getTemplate();
            Matcher parameterMatcher = Segment.getTemplateMatcher(template);

            StringBuffer sb = new StringBuffer();
            while (parameterMatcher.find())
            {
               String replacement = parameters[paramIndex].toString().replace("$", "\\$");
               parameterMatcher.appendReplacement(sb, replacement);
               paramIndex++;
            }
            parameterMatcher.appendTail(sb);
            resultSegments.add(sb.toString());
         }
         result = new URL(resultSegments, urlPattern.getMetadata());
      }
      else if (getParameterCount() > 0)
      {
         throw new PrettyException("Invalid number of parameters supplied: " + originalPattern + ", expected <"
                  + getParameterCount() + ">, got <0>");
      }

      return result;
   }
View Full Code Here

               }

            }
            catch (Exception e)
            {
               throw new PrettyException("PrettyFaces: Exception occurred while processing <" + mapping.getId() + ":"
                        + el + "> for URL <" + url + ">", e);
            }
         }
      }
   }
View Full Code Here

                  }
               }
               catch (Exception e)
               {
                  throw new PrettyException(
                           "PrettyFaces: Exception occurred while processing mapping<" + mapping.getId() + ":" + el
                                    + "> for query parameter named<" + name + "> " + e.getMessage(), e);
               }
            }
         }
View Full Code Here

TOP

Related Classes of com.ocpsoft.pretty.PrettyException

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.