public class QueryServlet extends TransformationServlet
| Modifier and Type | Field and Description |
|---|---|
protected static String |
LIMIT |
protected static String |
QUERY |
protected static String |
REF |
protected boolean |
writeQueryCookie |
CONTEXT, cookies, INFO, NON_VERIFYING_PARSER_CONFIGinfo, manager, MANAGER_PARAM, repository, REPOSITORY_PARAM, vfappConfig, APPLICATION_JAVASCRIPT, APPLICATION_SPARQL_RESULTS_XML, APPLICATION_XML, config, DEFAULT_JSONP_CALLBACK_PARAMETER, JSONP_CALLBACK_PARAMETER, JSONP_ENABLED, JSONP_VALIDATOR, log, MOZILLA, MSIE, SERVER_PASSWORD, SERVER_USER, SERVER_USER_PASSWORD, TEXT_HTML, TEXT_PLAIN, USER_AGENT| Constructor and Description |
|---|
QueryServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doPost(WorkbenchRequest req,
javax.servlet.http.HttpServletResponse resp,
String xslPath) |
String[] |
getCookieNames() |
protected String |
getQueryText(WorkbenchRequest req) |
void |
init(javax.servlet.ServletConfig config)
Initialize this instance of the servlet.
|
void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Long query strings could blow past the Tomcat default 8k HTTP header limit if stuffed into a cookie.
|
protected void |
service(WorkbenchRequest req,
javax.servlet.http.HttpServletResponse resp,
String xslPath) |
protected boolean |
shouldWriteQueryCookie(String queryText)
Determines if the servlet should write out the query text into a cookie as received, or write it's hash instead.
|
protected static void |
substituteQueryCache(Map<String,String> testQueryCache)
For testing purposes only.
|
protected void |
substituteQueryStorage(QueryStorage storage) |
servicesetRepository, setRepositoryInfo, setRepositoryManagercheckJSONP, getBooleanResultFormat, getJSONPResultFormat, getResultWriter, getServletConfig, getServletInfo, getTupleResultBuilder, getTupleResultFormat, serviceprotected static final String REF
protected static final String LIMIT
protected static final String QUERY
protected boolean writeQueryCookie
protected static void substituteQueryCache(Map<String,String> testQueryCache)
testQueryCache - cache to use instead of the production cache instanceprotected void substituteQueryStorage(QueryStorage storage)
public String[] getCookieNames()
getCookieNames in class TransformationServletpublic void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class TransformationServletconfig - configuration passed in by the application containerjavax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Servletdestroy in class AbstractServletpublic final void service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
TransformationServlet.service(HttpServletRequest, HttpServletResponse) is called. A much lower limit on
the size of the query text is used to stay well below the Tomcat limitation.service in class TransformationServletjavax.servlet.ServletExceptionIOExceptionprotected boolean shouldWriteQueryCookie(String queryText)
Determines if the servlet should write out the query text into a cookie as received, or write it's hash instead.
Note: This is a separate method for testing purposes.
queryText - the text received as the value for the parameter 'query'protected void service(WorkbenchRequest req, javax.servlet.http.HttpServletResponse resp, String xslPath) throws IOException, RDF4JException, BadRequestException
service in class TransformationServletIOExceptionRDF4JExceptionBadRequestExceptionprotected void doPost(WorkbenchRequest req, javax.servlet.http.HttpServletResponse resp, String xslPath) throws IOException, BadRequestException, RDF4JException
doPost in class TransformationServletIOExceptionBadRequestExceptionRDF4JExceptionprotected String getQueryText(WorkbenchRequest req) throws BadRequestException, RDF4JException
req - for looking at the request parametersBadRequestException - if a problem occurs grabbing the request from storageRDF4JException - if a problem occurs grabbing the request from storageCopyright © 2015-2021 Eclipse Foundation. All Rights Reserved.