URL Transforms

URLTransformer is provided as a basic 1.1 compatible* class for transcoding URLs (URLEncoder & URLDecoder were introduced in Java 1.2), for use in applets that do version checking (hence the 1.1 requirement) and have an interest in the URL query parameters (to use as parameters for the applet).

The table shows the transforms currently supported - it does not attempt to to provide an entire solution (e.g. no support for accented characters), but to cover the most common possibilities. The first record shows the transformation between '+' and ' ' (the space character).

* Note that while the URLTransformer itself is compatible with Java 1.1, we use a Swing based (Java 1.2+) JTable to display the values.

Usage

To use the URLTransformer:

  • Add the urltransformer.jar to the applet archive element.
  • From the Java code
    import org.pscode.tool.applet.URLTransformer;
    
    ...
    // instantiate an instance of the transformer
    URLTransformer transformer = new URLTransformer();
    ...
    // parse a string as might be found in an URL query..
    param = transformer.urlEncode( param );
    ...
    // parse a string to the form expected as an URL..
    param = transformer.urlDecode( param );
    
© 2003, 2004, 2005, 2006, 2007, 2008 by Andrew Thompson. All rights reserved.
Web hosting compliments of
Java Web Hosting
© 2003, 2004, 2005, 2006, 2007, 2008 by Andrew Thompson. All rights reserved.
Web hosting compliments of
Java Web Hosting
URLTransformer demo

URL Transforms

URLTransformer is provided as a basic 1.1 compatible* class for transcoding URLs (URLEncoder & URLDecoder were introduced in Java 1.2), for use in applets that do version checking (hence the 1.1 requirement) and have an interest in the URL query parameters (to use as parameters for the applet).

The table shows the transforms currently supported - it does not attempt to to provide an entire solution (e.g. no support for accented characters), but to cover the most common possibilities. The first record shows the transformation between '+' and ' ' (the space character).

* Note that while the URLTransformer itself is compatible with Java 1.1, we use a Swing based (Java 1.2+) JTable to display the values.

Usage

To use the URLTransformer:

  • Add the urltransformer.jar to the applet archive element.
  • From the Java code
    import org.pscode.tool.applet.URLTransformer;
    
    ...
    // instantiate an instance of the transformer
    URLTransformer transformer = new URLTransformer();
    ...
    // parse a string as might be found in an URL query..
    param = transformer.urlEncode( param );
    ...
    // parse a string to the form expected as an URL..
    param = transformer.urlDecode( param );
    
© 2003-2010 by Andrew Thompson. All rights reserved.
Web hosting compliments of Java Web Hosting.
Java Web Hosting
© 2003-2010 by Andrew Thompson. All rights reserved.
Web hosting compliments of Java Web Hosting.
Java Web Hosting