Package org.apache.wicket.request.target.coding

Examples of org.apache.wicket.request.target.coding.WebRequestEncoder


      {
        pageMapName = "";
      }
    }

    WebRequestEncoder encoder = new WebRequestEncoder(url);
    if (!application.getHomePage().equals(pageClass) ||
      !"".equals(pageMapName) ||
      (application.getHomePage().equals(pageClass) && requestTarget instanceof BookmarkableListenerInterfaceRequestTarget))
    {
      /*
       * Add <page-map-name>:<bookmarkable-page-class>
       *
       * Encode the url so it is correct even for class names containing non ASCII characters,
       * like ä, æ, ø, å etc.
       *
       * The reason for this is that when redirecting to these bookmarkable pages, we need to
       * have the url encoded correctly because we can't rely on the browser to interpret the
       * unencoded url correctly.
       */
      encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
        pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
    }

    // Get page parameters
    final PageParameters parameters = requestTarget.getPageParameters();
    if (parameters != null)
    {
      final Iterator<String> iterator = parameters.keySet().iterator();
      while (iterator.hasNext())
      {
        final String key = iterator.next();
        final String values[] = parameters.getStringArray(key);
        if (values != null)
        {
          for (int i = 0; i < values.length; i++)
          {
            encoder.addValue(key, values[i]);
          }
        }
      }
    }
    return url;
View Full Code Here


      CharSequence url = encodeUrlFor(target);

      if (params != null)
      {
        AppendingStringBuffer buff = new AppendingStringBuffer(url);
        WebRequestEncoder encoder = new WebRequestEncoder(buff);
        for (Entry<String, Object> stringObjectEntry : params.entrySet())
        {
          final String key = stringObjectEntry.getKey();
          final String value = stringObjectEntry.getValue().toString();
          encoder.addValue(key, value);
        }

        url = buff;
      }
      return url;
View Full Code Here

        else
        {
          pageMapName = "";
        }
        AppendingStringBuffer buffer = new AppendingStringBuffer(64);
        WebRequestEncoder encoder = new WebRequestEncoder(buffer);
        encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
          pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
        if (params != null)
        {
          final Iterator iterator;
          if (UnitTestSettings.getSortUrlParameters())
          {
            iterator = new TreeSet(params.keySet()).iterator();
          }
          else
          {
            iterator = params.keySet().iterator();
          }
          while (iterator.hasNext())
          {
            final String key = (String)iterator.next();
            final String values[] = params.getStringArray(key);
            if (values != null)
            {
              for (int i = 0; i < values.length; i++)
              {
                encoder.addValue(key, values[i]);
              }
            }
          }
        }
        String url = buffer.toString();
View Full Code Here

        else
        {
          pageMapName = "";
        }
        AppendingStringBuffer buffer = new AppendingStringBuffer(64);
        WebRequestEncoder encoder = new WebRequestEncoder(buffer);
        encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
          pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
        if (params != null)
        {
          final Iterator<String> iterator = params.keySet().iterator();
          while (iterator.hasNext())
          {
            final String key = iterator.next();
            final String values[] = params.getStringArray(key);
            if (values != null)
            {
              for (int i = 0; i < values.length; i++)
              {
                encoder.addValue(key, values[i]);
              }
            }
          }
        }
        String url = buffer.toString();
View Full Code Here

      {
        pageMapName = "";
      }
    }

    WebRequestEncoder encoder = new WebRequestEncoder(url);
    if (!application.getHomePage().equals(pageClass) ||
      !"".equals(pageMapName) ||
      (application.getHomePage().equals(pageClass) && requestTarget instanceof BookmarkableListenerInterfaceRequestTarget))
    {
      /*
       * Add <page-map-name>:<bookmarkable-page-class>
       *
       * Encode the url so it is correct even for class names containing non ASCII characters,
       * like ä, æ, ø, å etc.
       *
       * The reason for this is that when redirecting to these bookmarkable pages, we need to
       * have the url encoded correctly because we can't rely on the browser to interpret the
       * unencoded url correctly.
       */
      encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
        pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
    }

    // Get page parameters
    final PageParameters parameters = requestTarget.getPageParameters();
    if (parameters != null)
    {
      final Iterator iterator;
      if (UnitTestSettings.getSortUrlParameters())
      {
        iterator = new TreeSet(parameters.keySet()).iterator();
      }
      else
      {
        iterator = parameters.keySet().iterator();
      }
      while (iterator.hasNext())
      {
        final String key = (String)iterator.next();
        final String values[] = parameters.getStringArray(key);
        if (values != null)
        {
          for (int i = 0; i < values.length; i++)
          {
            encoder.addValue(key, values[i]);
          }
        }
      }
    }
    return url;
View Full Code Here

      CharSequence url = encodeUrlFor(target);

      if (params != null)
      {
        AppendingStringBuffer buff = new AppendingStringBuffer(url);
        WebRequestEncoder encoder = new WebRequestEncoder(buff);
        for (Entry<String, Object> stringObjectEntry : params.entrySet())
        {
          final String key = stringObjectEntry.getKey();
          final String value = stringObjectEntry.getValue().toString();
          encoder.addValue(key, value);
        }

        url = buff;
      }
      return url;
View Full Code Here

        else
        {
          pageMapName = "";
        }
        AppendingStringBuffer buffer = new AppendingStringBuffer(64);
        WebRequestEncoder encoder = new WebRequestEncoder(buffer);
        encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
          pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
        if (params != null)
        {
          final Iterator<String> iterator;
          if (UnitTestSettings.getSortUrlParameters())
          {
            iterator = new TreeSet<String>(params.keySet()).iterator();
          }
          else
          {
            iterator = params.keySet().iterator();
          }
          while (iterator.hasNext())
          {
            final String key = iterator.next();
            final String values[] = params.getStringArray(key);
            if (values != null)
            {
              for (int i = 0; i < values.length; i++)
              {
                encoder.addValue(key, values[i]);
              }
            }
          }
        }
        String url = buffer.toString();
View Full Code Here

      {
        pageMapName = "";
      }
    }

    WebRequestEncoder encoder = new WebRequestEncoder(url);
    if (!application.getHomePage().equals(pageClass) ||
      !"".equals(pageMapName) ||
      (application.getHomePage().equals(pageClass) && requestTarget instanceof BookmarkableListenerInterfaceRequestTarget))
    {
      /*
       * Add <page-map-name>:<bookmarkable-page-class>
       *
       * Encode the url so it is correct even for class names containing non ASCII characters,
       * like ä, æ, ø, å etc.
       *
       * The reason for this is that when redirecting to these bookmarkable pages, we need to
       * have the url encoded correctly because we can't rely on the browser to interpret the
       * unencoded url correctly.
       */
      encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
        pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
    }

    // Get page parameters
    final PageParameters parameters = requestTarget.getPageParameters();
    if (parameters != null)
    {
      final Iterator iterator;
      if (UnitTestSettings.getSortUrlParameters())
      {
        iterator = new TreeSet(parameters.keySet()).iterator();
      }
      else
      {
        iterator = parameters.keySet().iterator();
      }
      while (iterator.hasNext())
      {
        final String key = (String)iterator.next();
        final String values[] = parameters.getStringArray(key);
        if (values != null)
        {
          for (int i = 0; i < values.length; i++)
          {
            encoder.addValue(key, values[i]);
          }
        }
      }
    }
    return url;
View Full Code Here

      {
        pageMapName = "";
      }
    }

    WebRequestEncoder encoder = new WebRequestEncoder(url);
    if (!application.getHomePage().equals(pageClass) ||
        !"".equals(pageMapName) ||
        (application.getHomePage().equals(pageClass) && requestTarget instanceof BookmarkableListenerInterfaceRequestTarget))
    {
      /*
       * Add <page-map-name>:<bookmarkable-page-class>
       *
       * Encode the url so it is correct even for class names containing
       * non ASCII characters, like ä, æ, ø, å etc.
       *
       * The reason for this is that when redirecting to these
       * bookmarkable pages, we need to have the url encoded correctly
       * because we can't rely on the browser to interpret the unencoded
       * url correctly.
       */
      encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
          pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
    }

    // Get page parameters
    final PageParameters parameters = requestTarget.getPageParameters();
    if (parameters != null)
    {
      final Iterator iterator;
      if (UnitTestSettings.getSortUrlParameters())
      {
        iterator = new TreeSet(parameters.keySet()).iterator();
      }
      else
      {
        iterator = parameters.keySet().iterator();
      }
      while (iterator.hasNext())
      {
        final String key = (String)iterator.next();
        final String values[] = parameters.getStringArray(key);
        if (values != null)
        {
          for (int i = 0; i < values.length; i++)
          {
            encoder.addValue(key, values[i]);
          }
        }
      }
    }
    return url;
View Full Code Here

      {
        pageMapName = "";
      }
    }

    WebRequestEncoder encoder = new WebRequestEncoder(url);
    if (!application.getHomePage().equals(pageClass) ||
      !"".equals(pageMapName) ||
      (application.getHomePage().equals(pageClass) && requestTarget instanceof BookmarkableListenerInterfaceRequestTarget))
    {
      /*
       * Add <page-map-name>:<bookmarkable-page-class>
       *
       * Encode the url so it is correct even for class names containing non ASCII characters,
       * like ä, æ, ø, å etc.
       *
       * The reason for this is that when redirecting to these bookmarkable pages, we need to
       * have the url encoded correctly because we can't rely on the browser to interpret the
       * unencoded url correctly.
       */
      encoder.addValue(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME,
        pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
    }

    // Get page parameters
    final PageParameters parameters = requestTarget.getPageParameters();
    if (parameters != null)
    {
      final Iterator<String> iterator = parameters.keySet().iterator();
      while (iterator.hasNext())
      {
        final String key = iterator.next();
        final String values[] = parameters.getStringArray(key);
        if (values != null)
        {
          for (int i = 0; i < values.length; i++)
          {
            encoder.addValue(key, values[i]);
          }
        }
      }
    }
    return url;
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.target.coding.WebRequestEncoder

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.