public class PageServiceEncoder extends java.lang.Object implements ServiceEncoder
ServiceEncoder, it encodes
page name and a service name. The page name becomes the servlet path, prefixed with "/" and
suffixed with a dot and a particular extension. In this way, "/app?service=page&page=Home"
becomes simply "Home.html". This is most suitable for the "page" and "external" services.| Constructor and Description |
|---|
PageServiceEncoder() |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ServiceEncoding encoding)
Invoked to decode a request.
|
void |
encode(ServiceEncoding encoding)
Invoked by the
LinkFactory to encode the request. |
void |
setExtension(java.lang.String extension) |
void |
setServiceName(java.lang.String serviceName) |
public PageServiceEncoder()
public void encode(ServiceEncoding encoding)
ServiceEncoderLinkFactory to encode the request.
Encoding is the process of modifying the encoding object to represent the same data in a
different format; the canoncial example is to replace the
ServiceConstants.PAGEand
ServiceConstants.SERVICEquery parameters with a servlet
path (i.e., "/Home.html", if the ".html" extension is mapped to the page service).
The LinkFactory iterates over a collection of
encoders, stopping once the ServiceRequestEncoding is modified in any way.
encode in interface ServiceEncoderpublic void decode(ServiceEncoding encoding)
ServiceEncoderdecode in interface ServiceEncoderpublic void setExtension(java.lang.String extension)
public void setServiceName(java.lang.String serviceName)