Class ApplicationServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.nuxeo.ecm.webengine.rest.servlet.ApplicationServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable,ResourceLocator,Reloadable,ManagedServlet
- Direct Known Subclasses:
WebEngineServlet
public class ApplicationServlet
extends jakarta.servlet.http.HttpServlet
implements ManagedServlet, Reloadable, ResourceLocator
A hot re-loadable REST servlet. This servlet is building a Jersey REST Application.
Use it as the webengine servlet in web.xml if you want hot reload, otherwise directly use the Jersey servlet:
ServletContainer.
- Author:
- Bogdan Stefanescu
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ApplicationHostprotected org.osgi.framework.Bundleprotected org.glassfish.jersey.servlet.ServletContainerprotected booleanprotected StringFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcontainerService(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected org.glassfish.jersey.servlet.ServletContainervoiddestroy()protected voidprotected voidprotected voiddoGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) org.osgi.framework.Bundleorg.glassfish.jersey.servlet.ServletContainergetResourceFile(String key) Get a file resource given a keygetResourceURL(String key) Gets an URL resource given a keyvoidinit(jakarta.servlet.ServletConfig config) protected voidprotected RenderingEngineinitRendering(jakarta.servlet.ServletConfig config) voidreload()protected voidvoidservice(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) voidMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
isDirty
protected volatile boolean isDirty -
bundle
protected org.osgi.framework.Bundle bundle -
app
-
container
protected org.glassfish.jersey.servlet.ServletContainer container -
resourcesPrefix
-
-
Constructor Details
-
ApplicationServlet
public ApplicationServlet()
-
-
Method Details
-
setDescriptor
- Specified by:
setDescriptorin interfaceManagedServlet
-
init
public void init(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException - Specified by:
initin interfacejakarta.servlet.Servlet- Overrides:
initin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Servlet- Overrides:
destroyin classjakarta.servlet.GenericServlet
-
reload
public void reload()- Specified by:
reloadin interfaceReloadable
-
getRenderingEngine
-
getBundle
public org.osgi.framework.Bundle getBundle() -
getContainer
public org.glassfish.jersey.servlet.ServletContainer getContainer() -
service
public void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Overrides:
servicein classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
containerService
protected void containerService(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Throws:
jakarta.servlet.ServletExceptionIOException
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException - Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
initRendering
protected RenderingEngine initRendering(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException - Throws:
jakarta.servlet.ServletException
-
destroyRendering
protected void destroyRendering() -
initContainer
protected void initContainer() throws jakarta.servlet.ServletException- Throws:
jakarta.servlet.ServletException
-
destroyContainer
protected void destroyContainer() -
reloadContainer
protected void reloadContainer() throws jakarta.servlet.ServletException- Throws:
jakarta.servlet.ServletException
-
createServletContainer
-
getResourceFile
Description copied from interface:ResourceLocatorGet a file resource given a key- Specified by:
getResourceFilein interfaceResourceLocator
-
getResourceURL
Description copied from interface:ResourceLocatorGets an URL resource given a key- Specified by:
getResourceURLin interfaceResourceLocator- Parameters:
key- the resource key- Returns:
- the resource URL or null if no such result was found
-