org.apache.tapestry.engine
Interface ServiceEncoding

All Known Implementing Classes:
ServiceEncodingImpl

public interface ServiceEncoding

Contains the information needed to encode a request for a service; the servlet path plus and query parameters. The service encoding is passed to each ServiceEncoder , which is allowed to modify the encoding (typically, by changing the servlet path and settting query parameters to null). From this modified encoding, an ILinkcan be constructed.

Additionally, when a request is dispatched by Tapestry, an SRE is also created and passed to each ServiceEncoder for decoding. Here, the query parameters that may have been nulled out by the encoding are restored.

Since:
4.0
Author:
Howard M. Lewis Ship
See Also:
ServiceConstants

Method Summary
 String[] getParameterNames()
          Returns an array of parameter names.
 String getParameterValue(String name)
          Returns the value for the named parameter.
 String[] getParameterValues(String name)
          Returns the value for the named parameter.
 String getPathInfo()
          Returns the portion of the URL after the servlet itself.
 String getServletPath()
          Returns the servlet path for the request.
 void setParameterValue(String name, String value)
          Sets the value for the named query parameter to the provided string.
 void setParameterValues(String name, String[] values)
          Sets the values for a named query parameter.
 void setServletPath(String servletPath)
          Updates the servlet path for the encoding.
 

Method Detail

getParameterValue

String getParameterValue(String name)
Returns the value for the named parameter. If multiple values are stored for the query parameter, only the first is returned.

Returns:
the value, or null if no such query parameter exists

getParameterValues

String[] getParameterValues(String name)
Returns the value for the named parameter.

Returns:
the values, or null if no such query parameter exists

setServletPath

void setServletPath(String servletPath)
Updates the servlet path for the encoding. In some cases, this is a combination of the servlet and additional path info.


setParameterValue

void setParameterValue(String name,
                       String value)
Sets the value for the named query parameter to the provided string.

Parameters:
name - the name of the parameter to set.
value - the new value, which may be null.

setParameterValues

void setParameterValues(String name,
                        String[] values)
Sets the values for a named query parameter.


getServletPath

String getServletPath()
Returns the servlet path for the request. This is the portion of the URL recognized as the servlet. When the URL pattern (in web.xml) ends in a "*" (such as "/book/*"), this method will return the matched servlet portion ("/book/") and {#link #getPathInfo} will return the rest of the URL.


getPathInfo

String getPathInfo()
Returns the portion of the URL after the servlet itself.

Returns:
pathInfo if path info was supplied in the request, or null otherwise.

getParameterNames

String[] getParameterNames()
Returns an array of parameter names. The names are returned in alphabetically sorted order. This list includes all parameter names, even those for which the stored value is null.



Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.