org.apache.myfaces.custom.util
Class URIComponentUtils

java.lang.Object
  extended by org.apache.myfaces.custom.util.URIComponentUtils

public abstract class URIComponentUtils
extends java.lang.Object

This utility class provides equivalents to the JavaScript encodeURIComponent(uri) and decodeURIComponent(encodedURI) functions.

Author:
Gerald Müllan Date: 11.02.2007 Time: 23:30:08

Constructor Summary
URIComponentUtils()
           
 
Method Summary
static java.lang.String decodeURIComponent(java.lang.String encodedURI)
          In case of incoming Strings - encoded with js encodeURIComponent() e.g.
static java.lang.String encodeURIComponent(java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URIComponentUtils

public URIComponentUtils()
Method Detail

encodeURIComponent

public static java.lang.String encodeURIComponent(java.lang.String uri)

decodeURIComponent

public static java.lang.String decodeURIComponent(java.lang.String encodedURI)
In case of incoming Strings - encoded with js encodeURIComponent() e.g. ö -> %C3%B6 - it is not sufficient to set CharacterEncoding on the ResponseWriter accordingly. Passing the uri to decodeURIComponent(String encodedURI) decodes e.g. %C3%B6 back to ö.

Parameters:
encoded - uri String
Returns:
decoded uri String


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.