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_CONFIG
info, manager, MANAGER_PARAM, repository, REPOSITORY_PARAM, vf
appConfig, 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, 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) |
service
setRepository, setRepositoryInfo, setRepositoryManager
checkJSONP, getBooleanResultFormat, getJSONPResultFormat, getResultWriter, getServletConfig, getServletInfo, getTupleResultBuilder, getTupleResultFormat, service
protected 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 TransformationServlet
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class TransformationServlet
config
- configuration passed in by the application containerjavax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class AbstractServlet
public 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 TransformationServlet
javax.servlet.ServletException
IOException
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.
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, org.json.JSONException
service
in class TransformationServlet
IOException
RDF4JException
BadRequestException
org.json.JSONException
protected void doPost(WorkbenchRequest req, javax.servlet.http.HttpServletResponse resp, String xslPath) throws IOException, BadRequestException, RDF4JException, org.json.JSONException
doPost
in class TransformationServlet
IOException
BadRequestException
RDF4JException
org.json.JSONException
protected 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-2020 Eclipse Foundation. All Rights Reserved.