|
||||||||||
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 web query servlets. It is the server counterpart to
Query
.
Nested Class Summary | |
---|---|
static class |
QueryServlet.Credentials
User credentials, which will be made availale if the servlet's authenticationRequired flag is set to true. |
static class |
QueryServlet.Method
Supported HTTP methods. |
Constructor Summary | |
---|---|
QueryServlet()
|
Method Summary | |
---|---|
protected void |
authorize()
Authorizes the current request, and throws a LoginException if the request is not authorized. |
protected void |
doDelete()
Called when an HTTP DELETE is received. |
protected void |
doDelete(HttpServletRequest request,
HttpServletResponse response)
|
protected Object |
doGet()
Called when an HTTP GET is received. |
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doHead(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doOptions(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doPost(HttpServletRequest request,
HttpServletResponse response)
|
protected URL |
doPost(Object value)
Called when an HTTP POST is received. |
protected void |
doPut(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doPut(Object value)
Called when an HTTP PUT is received. |
protected void |
doTrace(HttpServletRequest request,
HttpServletResponse response)
|
String |
getContextPath()
Returns the portion of the request URI that indicates the context of the request. |
QueryServlet.Credentials |
getCredentials()
Gets the authentication credentials that were extracted from the request. |
String |
getHostname()
Gets the host name that was requested. |
QueryServlet.Method |
getMethod()
Gets the HTTP method with which the current request was made. |
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. |
String |
getQueryPath()
Returns the portion of the request URI that occurs after the context path but preceding the query string. |
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. |
Class<? extends Serializer<?>> |
getSerializerClass()
Returns the class of serializer that will be used to stream the value passed to or from the web query. |
boolean |
isAuthenticationRequired()
Tells whether or not this servlet will require authentication data. |
boolean |
isDetermineContentLength()
Tells whether this servlet is configured to always determine the content length of outgoing responses and set the Content-Length HTTP response header accordingly. |
boolean |
isSecure()
Tells whether the request has been ecrypted over HTTPS. |
protected void |
service(HttpServletRequest request,
HttpServletResponse response)
|
void |
setAuthenticationRequired(boolean authenticationRequired)
Sets whether or not this servlet will require authentication data. |
void |
setDetermineContentLength(boolean determineContentLength)
Sets the value of the determineContentLength flag. |
void |
setSerializerClass(Class<? extends Serializer<?>> serializerClass)
Sets the class of serializer that will be used to stream the value passed to or from the web query. |
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 |
Constructor Detail |
---|
public QueryServlet()
Method Detail |
---|
public boolean isDetermineContentLength()
public void setDetermineContentLength(boolean determineContentLength)
isDetermineContentLength()
public boolean isAuthenticationRequired()
public void setAuthenticationRequired(boolean authenticationRequired)
public Class<? extends Serializer<?>> getSerializerClass()
JSONSerializer
is
used.
public void setSerializerClass(Class<? extends Serializer<?>> serializerClass)
serializerClass
- This servlet's serializer class (must be non-null)public String getHostname()
public String getContextPath()
public String getQueryPath()
public int getPort()
public boolean isSecure()
public String getProtocol()
public QueryServlet.Method getMethod()
public QueryServlet.Credentials getCredentials()
public QueryDictionary getParameters()
public QueryDictionary getRequestHeaders()
public QueryDictionary getResponseHeaders()
protected Object doGet() throws ServletException
Request parameters, and request/response headers are available to subclasses via the corresponding query dictionary.
ServletException
getParameters()
,
getRequestHeaders()
,
getResponseHeaders()
protected URL doPost(Object value) throws ServletException
Request parameters, and request/response headers are available to subclasses via the corresponding query dictionary.
value
- The object that is being posted by the client. This object will have
been de-serialized from within the request by this servlet's serializer
ServletException
getParameters()
,
getRequestHeaders()
,
getResponseHeaders()
protected void doPut(Object value) throws ServletException
Request parameters, and request/response headers are available to subclasses via the corresponding query dictionary.
value
- The object that is being updated by the client. This object will have
been de-serialized from within the request by this servlet's serializer
ServletException
getParameters()
,
getRequestHeaders()
,
getResponseHeaders()
protected void doDelete() throws ServletException
Request parameters, and request/response headers are available to subclasses via the corresponding query dictionary.
ServletException
getParameters()
,
getRequestHeaders()
,
getResponseHeaders()
protected void authorize() throws ServletException, LoginException
This method is guaranteed to be called after the arguments and request properties have been made available.
LoginException
- Thrown if the request is not authorized
ServletException
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 |