public class ServletStartup
extends javax.servlet.http.HttpServlet
This startup must be defined in web.xml
file.
<servlet> <servlet-name>Ignite</servlet-name> <servlet-class>org.apache.ignite.startup.servlet.ServletStartup</servlet-class> <init-param> <param-name>cfgFilePath</param-name> <param-value>config/default-config.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
Servlet-based startup may be used in any web container like Tomcat, Jetty and etc. Depending on the way this startup is deployed the Ignite instance can be accessed by either all web applications or by only one. See web container class loading architecture:
$TOMCAT_HOME/conf/catalina.properties
for property shared.loader
the following $IGNITE_HOME/ignite.jar,$IGNITE_HOME/libs/*.jar
(replace $IGNITE_HOME
with absolute path).
$TOMCAT_HOME/conf/web.xml
<servlet> <servlet-name>Ignite</servlet-name> <servlet-class>org.apache.ignite.startup.servlet.ServletStartup</servlet-class> <init-param> <param-name>cfgFilePath</param-name> <param-value>config/default-config.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
web.xml
file and all libraries should
be added in WAR file without changes in Tomcat configuration files.
Server service = new Server(); service.addListener("localhost:8090"); ServletHttpContext ctx = (ServletHttpContext)service.getContext("/"); ServletHolder servlet = ctx.addServlet("Ignite", "/IgniteStartup", "org.apache.ignite.startup.servlet.ServletStartup"); servlet.setInitParameter("cfgFilePath", "config/default-config.xml"); servlet.setInitOrder(1); servlet.start(); service.start();
Constructor and Description |
---|
ServletStartup() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
init() |
String |
toString() |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019