org.apache.wicket.protocol.http
Class WicketURLDecoder

java.lang.Object
  extended by org.apache.wicket.protocol.http.WicketURLDecoder

public class WicketURLDecoder
extends Object

Adapted from java.net.URLDecoder, but defines instances for query string decoding versus URL path component decoding.

The difference is important because a space is encoded as a + in a query string, but this is a valid value in a path component (and is therefore not decode back to a space).

Author:
Doug Donohoe
See Also:
URLDecoder, "http://www.ietf.org/rfc/rfc2396.txt"}

Field Summary
static WicketURLDecoder PATH_INSTANCE
          Encoder used to decode components of a path.

For example: http://org.acme/foo/thispart/orthispart?butnot=thispart
static WicketURLDecoder QUERY_INSTANCE
          Encoder used to decode name or value components of a query string.

For example: http://org.acme/notthis/northis/oreventhis?buthis=isokay&asis=thispart
 
Method Summary
 String decode(String s)
          Calls decode with the application response request encoding as returned by Application.get().getRequestCycleSettings().getResponseRequestEncoding()
 String decode(String s, String enc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY_INSTANCE

public static final WicketURLDecoder QUERY_INSTANCE
Encoder used to decode name or value components of a query string.

For example: http://org.acme/notthis/northis/oreventhis?buthis=isokay&asis=thispart


PATH_INSTANCE

public static final WicketURLDecoder PATH_INSTANCE
Encoder used to decode components of a path.

For example: http://org.acme/foo/thispart/orthispart?butnot=thispart

Method Detail

decode

public String decode(String s)
Calls decode with the application response request encoding as returned by Application.get().getRequestCycleSettings().getResponseRequestEncoding()

Parameters:
s - Value to encode
Returns:
String encoded using default Application request/respose encoding

decode

public String decode(String s,
                     String enc)
Parameters:
s - string to decode
enc - encoding to decode with
Returns:
decoded string
See Also:
URLDecoder.decode(String, String)


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.