com.noelios.restlet.ext.servlet
Class ServletWarClientHelper
java.lang.Object
org.restlet.util.Helper<T>
com.noelios.restlet.ConnectorHelper<Client>
com.noelios.restlet.ClientHelper
com.noelios.restlet.local.LocalClientHelper
com.noelios.restlet.local.EntityClientHelper
com.noelios.restlet.ext.servlet.ServletWarClientHelper
- Direct Known Subclasses:
- XdbServletWarClientHelper
public class ServletWarClientHelper
- extends EntityClientHelper
Client connector based on a Servlet context (JEE Web application context).
Here is a sample resource URI:
war:///path/to/my/resource/entry.txt
You can note that there is no authority which is denoted by the sequence of
three "/" characters. This connector is designed to be used inside a context
(e.g. inside a servlet based application) and subconsequently does not
require the use of a authority. Such URI are "relative" to the root of the
servlet context.
Here is a sample code excerpt that illustrates the way to use this connector:
Response response = getContext().getClientDispatcher().get("war:///myDir/test.txt");
if (response.isEntityAvailable()) {
//Do what you want to do.
}
- Author:
- Jerome Louvel
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServletWarClientHelper
public ServletWarClientHelper(Client client,
ServletContext servletContext)
- Constructor.
- Parameters:
client
- The client to help.servletContext
- The Servlet context.
getEntity
public Entity getEntity(java.lang.String decodedPath)
- Specified by:
getEntity
in class EntityClientHelper
getServletContext
public ServletContext getServletContext()
- Returns the Servlet context.
- Returns:
- The Servlet context.
handle
public void handle(Request request,
Response response)
- Overrides:
handle
in class EntityClientHelper
Copyright © 2005-2008 Noelios Technologies.