Package org.apache.wicket.util.encoding
Class UrlEncoder
- java.lang.Object
-
- org.apache.wicket.util.encoding.UrlEncoder
-
public class UrlEncoder extends Object
Adapted from Spring Framework's UriUtils class, but defines instances for query string encoding versus URL path component encoding. 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:
- Thomas Heigl
- See Also:
- RFC-2396
-
-
Field Summary
Fields Modifier and Type Field Description static UrlEncoder
HEADER_INSTANCE
Encoder used to encode a header.static UrlEncoder
PATH_INSTANCE
Encoder used to encode segments of a path.
For example: http://org.acme/foo/thispart/orthispart?butnot=thispartstatic UrlEncoder
QUERY_INSTANCE
Encoder used to encode name or value components of a query string.
For example: http://org.acme/notthis/northis/oreventhis?buthis=isokay&asis=thispart
-
Constructor Summary
Constructors Modifier Constructor Description protected
UrlEncoder(org.apache.wicket.util.encoding.UrlEncoder.Type type)
Allow subclass to call constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
encode(String s, String charsetName)
String
encode(String unsafeInput, Charset charset)
-
-
-
Field Detail
-
QUERY_INSTANCE
public static final UrlEncoder QUERY_INSTANCE
Encoder used to encode 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 UrlEncoder PATH_INSTANCE
Encoder used to encode segments of a path.
For example: http://org.acme/foo/thispart/orthispart?butnot=thispart
-
HEADER_INSTANCE
public static final UrlEncoder HEADER_INSTANCE
Encoder used to encode a header.
-
-
Constructor Detail
-
UrlEncoder
protected UrlEncoder(org.apache.wicket.util.encoding.UrlEncoder.Type type)
Allow subclass to call constructor.- Parameters:
type
- encoder type
-
-