Package com.ocpsoft.pretty.faces.url

Examples of com.ocpsoft.pretty.faces.url.QueryString


         String contextPath = prettyContext.getContextPath();
         if (PrettyContext.PRETTY_PREFIX.equals(action) && prettyContext.isPrettyRequest())
         {
            URL url = prettyContext.getRequestURL();
            QueryString query = prettyContext.getRequestQueryString();

            String target = contextPath + url.encode().toURL() + query.toQueryString();
            log.trace("Refreshing requested page [" + url + "]");
            String redirectUrl = externalContext.encodeRedirectURL(target, null);
            externalContext.redirect(redirectUrl);
            return true;
         }
View Full Code Here


         }
         viewId = FacesNavigationURLCanonicalizer.normalizeRequestURI(context, viewId);

         URL url = new URL(viewId);
         url.getMetadata().setLeadingSlash(true);
         QueryString qs = QueryString.build("");
         if (viewId.contains("?"))
         {
            qs.addParameters(viewId);
         }
         qs.addParameters("?" + PrettyFacesWrappedResponse.REWRITE_MAPPING_ID_KEY + "=" + mapping.getId());

         viewId = url.toString() + qs.toQueryString();

         NavigationCase navigationCase = parent.getNavigationCase(context, fromAction, viewId);
         return navigationCase;
      }
      else
View Full Code Here

   private void injectQueryParams(final FacesContext context, final UrlMapping mapping,
            final PrettyContext prettyContext)
   {
      boolean isPostback = FacesStateUtils.isPostback(context);
      List<QueryParameter> params = mapping.getQueryParams();
      QueryString queryString = prettyContext.getRequestQueryString();
      for (QueryParameter param : params)
      {
         // check if to skip this QueryParameter due to onPostback attribute
         if (!param.isOnPostback() && isPostback)
         {
            continue;
         }

         String el = param.getExpression().getELExpression();
         if ((el != null) && !"".equals(el.trim()))
         {
            String name = param.getName();
            if (queryString.getParameterMap().containsKey(name))
            {
               try
               {
                  if (elUtils.getExpectedType(context, el).isArray())
                  {
                     String[] values = queryString.getParameterValues(name);
                     elUtils.setValue(context, el, values);
                  }
                  else
                  {

                     String valueAsString = queryString.getParameter(name);

                     // get the type of the referenced property and try to obtain a converter for it
                     Class<?> expectedType = elUtils.getExpectedType(context, el);
                     Converter converter = context.getApplication().createConverter(expectedType);
View Full Code Here

      return result;
   }

   public QueryString buildQueryString(final UrlMapping mapping)
   {
      QueryString result = new QueryString();

      String expression = "";
      Object value = null;
      try
      {
View Full Code Here

TOP

Related Classes of com.ocpsoft.pretty.faces.url.QueryString

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.