|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.pivot.web.server.QueryServlet
public abstract class QueryServlet
Abstract base class for query servlets.
Nested Class Summary | |
---|---|
static class |
QueryServlet.Path
Immutable string sequence representing a query path. |
Field Summary | |
---|---|
static String |
CONTENT_LENGTH_HEADER
|
static String |
CONTENT_TYPE_HEADER
|
static String |
HTTP_PROTOCOL
|
static String |
HTTPS_PROTOCOL
|
static String |
LOCATION_HEADER
|
static String |
URL_ENCODING
|
Constructor Summary | |
---|---|
QueryServlet()
|
Method Summary | |
---|---|
protected abstract Serializer<?> |
createSerializer(Query.Method method,
QueryServlet.Path path)
Creates a serializer that will be used to serialize the current request data. |
protected void |
dispose()
Disposes any resources allocated in prepare() . |
protected void |
doDelete(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doDelete(QueryServlet.Path path)
Handles an HTTP GET request. |
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response)
|
protected Object |
doGet(QueryServlet.Path path)
Handles an HTTP GET request. |
protected void |
doHead(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doOptions(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doPost(HttpServletRequest request,
HttpServletResponse response)
|
protected URL |
doPost(QueryServlet.Path path,
Object value)
Handles an HTTP POST request. |
protected void |
doPut(HttpServletRequest request,
HttpServletResponse response)
|
protected boolean |
doPut(QueryServlet.Path path,
Object value)
Handles an HTTP GET request. |
protected void |
doTrace(HttpServletRequest request,
HttpServletResponse response)
|
String |
getContextPath()
Returns the portion of the request URL representing the context path. |
String |
getHostname()
Gets the host name that was requested. |
URL |
getLocation()
Returns the location of this servlet. |
QueryDictionary |
getParameters()
Returns the servlet's parameter dictionary, which holds the values passed in the HTTP request query string. |
int |
getPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received. |
String |
getProtocol()
Returns the name of the HTTP protocol that the request is using. |
QueryDictionary |
getRequestHeaders()
Returns the servlet's request header dictionary, which holds the HTTP request headers. |
QueryDictionary |
getResponseHeaders()
Returns the servlet's response header dictionary, which holds the HTTP response headers that will be sent back to the client. |
String |
getServletPath()
Returns the portion of the request URL representing the servlet path. |
boolean |
isSecure()
Tells whether the request has been ecrypted over HTTPS. |
protected void |
prepare()
Prepares a servlet for request execution. |
protected void |
service(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
validate(Query.Method method,
QueryServlet.Path path)
Validates a servlet for request execution. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String HTTP_PROTOCOL
public static final String HTTPS_PROTOCOL
public static final String URL_ENCODING
public static final String CONTENT_TYPE_HEADER
public static final String CONTENT_LENGTH_HEADER
public static final String LOCATION_HEADER
Constructor Detail |
---|
public QueryServlet()
Method Detail |
---|
public String getHostname()
public int getPort()
public String getContextPath()
public String getServletPath()
public boolean isSecure()
public String getProtocol()
public URL getLocation()
public QueryDictionary getParameters()
public QueryDictionary getRequestHeaders()
public QueryDictionary getResponseHeaders()
protected void prepare() throws ServletException
validate(Query.Method, Path)
method.
The default implementation is a no-op.
ServletException
protected void dispose() throws ServletException
prepare()
. This method is
guaranteed to be called even if the HTTP handler method throws.
The default implementation is a no-op.
ServletException
protected void validate(Query.Method method, QueryServlet.Path path) throws QueryException
The default implementation is a no-op.
method
- path
-
QueryException
protected Object doGet(QueryServlet.Path path) throws QueryException
path
-
QueryException
protected URL doPost(QueryServlet.Path path, Object value) throws QueryException
path
- value
-
QueryException
protected boolean doPut(QueryServlet.Path path, Object value) throws QueryException
path
- value
-
QueryException
protected void doDelete(QueryServlet.Path path) throws QueryException
path
-
QueryException
protected abstract Serializer<?> createSerializer(Query.Method method, QueryServlet.Path path) throws QueryException
method
- path
-
QueryException
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
service
in class HttpServlet
IOException
ServletException
protected final void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doGet
in class HttpServlet
IOException
ServletException
protected final void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doPost
in class HttpServlet
IOException
ServletException
protected final void doPut(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doPut
in class HttpServlet
IOException
ServletException
protected final void doDelete(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doDelete
in class HttpServlet
IOException
ServletException
protected final void doHead(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doHead
in class HttpServlet
IOException
ServletException
protected final void doOptions(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doOptions
in class HttpServlet
IOException
ServletException
protected final void doTrace(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doTrace
in class HttpServlet
IOException
ServletException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |