|
||||||||||
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
pivot.web.server.QueryServlet
public abstract class QueryServlet
Abstract base class for web query servlets. It is the server counterpart to
pivot.web.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. |
protected static class |
QueryServlet.Method
The 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()
|
protected void |
doDelete(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected Object |
doGet()
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
doHead(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
doOptions(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected URL |
doPost(Object value)
|
protected void |
doPut(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
doPut(Object value)
|
protected void |
doTrace(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.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. |
Serializer<?> |
getSerializer()
Returns the serializer 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(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.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 |
setSerializer(Serializer<?> serializer)
Sets the serializer 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 String getHostname()
public String getContextPath()
public String getQueryPath()
public int getPort()
public boolean isSecure()
public String getProtocol()
public QueryServlet.Method getMethod()
public boolean isDetermineContentLength()
public void setDetermineContentLength(boolean determineContentLength)
isDetermineContentLength()
public boolean isAuthenticationRequired()
public void setAuthenticationRequired(boolean authenticationRequired)
public QueryServlet.Credentials getCredentials()
public QueryDictionary getParameters()
public QueryDictionary getRequestHeaders()
public QueryDictionary getResponseHeaders()
public Serializer<?> getSerializer()
JSONSerializer
is used.
public void setSerializer(Serializer<?> serializer)
serializer
- The serializer (must be non-null).protected Object doGet() throws javax.servlet.ServletException
javax.servlet.ServletException
protected URL doPost(Object value) throws javax.servlet.ServletException
javax.servlet.ServletException
protected void doPut(Object value) throws javax.servlet.ServletException
javax.servlet.ServletException
protected void doDelete() throws javax.servlet.ServletException
javax.servlet.ServletException
protected void authorize() throws javax.servlet.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
javax.servlet.ServletException
protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
service
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
protected final void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doGet
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
protected final void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doPost
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
protected final void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doPut
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
protected final void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doDelete
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
protected final void doHead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doHead
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
protected final void doOptions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doOptions
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
protected final void doTrace(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
doTrace
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |