public class SparkServlet
extends javax.servlet.http.HttpServlet
SparkApplication
s. Needs to be
initialized with the applicationName
init parameter (or through a direct call to setSparkApplications(List)
) to the list of application classes defining routes. An optional
wrapperSupplierName
parameter can be provided (or directly set through the setRequestSupplier(BiFunction)
method) to provide added path flexibility.Constructor and Description |
---|
SparkServlet() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
init(javax.servlet.ServletConfig config) |
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
setFilterMappingPattern(String filterMappingPattern) |
void |
setRequestSupplier(BiFunction<javax.servlet.http.HttpServletRequest,String,javax.servlet.http.HttpServletRequestWrapper> requestSupplier) |
void |
setSparkApplications(List<spark.servlet.SparkApplication> sparkApplications) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public void setRequestSupplier(BiFunction<javax.servlet.http.HttpServletRequest,String,javax.servlet.http.HttpServletRequestWrapper> requestSupplier)
public void setSparkApplications(List<spark.servlet.SparkApplication> sparkApplications)
public void setFilterMappingPattern(String filterMappingPattern)
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
service
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
This work is licensed under a Creative Commons Attribution 4.0 International License.