org.apache.tapestry.engine.encoders
Class PageServiceEncoder
java.lang.Object
org.apache.tapestry.engine.encoders.PageServiceEncoder
- All Implemented Interfaces:
- ServiceEncoder
public class PageServiceEncoder
- extends java.lang.Object
- implements ServiceEncoder
The canonical implementation of 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.
- Since:
- 4.0
- Author:
- Howard M. Lewis Ship
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PageServiceEncoder
public PageServiceEncoder()
encode
public void encode(ServiceEncoding encoding)
- Description copied from interface:
ServiceEncoder
- Invoked by the
LinkFactory
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.PAGE
and
ServiceConstants.SERVICE
query 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.
- Specified by:
encode
in interface ServiceEncoder
decode
public void decode(ServiceEncoding encoding)
- Description copied from interface:
ServiceEncoder
- Invoked to decode a request. The encoder is responsible for recognizing a request it may have
encoded, and for restoring any query parameters is may have removed.
- Specified by:
decode
in interface ServiceEncoder
setExtension
public void setExtension(java.lang.String extension)
setServiceName
public void setServiceName(java.lang.String serviceName)