Class CdiVaadinServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
com.vaadin.flow.server.VaadinServlet
com.vaadin.cdi.CdiVaadinServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class CdiVaadinServlet extends com.vaadin.flow.server.VaadinServlet
Servlet to create CdiVaadinServletService.

An instance of this servlet is automatically deployed by CdiServletDeployer if no VaadinServlet is deployed based on web.xml or Servlet 3.0 annotations. A subclass of this servlet and of CdiVaadinServletService can be used and explicitly deployed to customize it, in which case createServletService(DeploymentConfiguration) must call service.init() .

See Also:
  • Field Summary

    Fields inherited from class com.vaadin.flow.server.VaadinServlet

    INTERNAL_VAADIN_SERVLET_VITE_DEV_MODE_FRONTEND_PATH

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.vaadin.flow.server.VaadinServletService
    createServletService(com.vaadin.flow.function.DeploymentConfiguration configuration)
     
    static String
    Name of the Vaadin servlet for the current thread.
    void
    init(jakarta.servlet.ServletConfig servletConfig)
     
    protected void
    service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     

    Methods inherited from class com.vaadin.flow.server.VaadinServlet

    createDeploymentConfiguration, createDeploymentConfiguration, createServletService, createStaticFileHandler, createVaadinRequest, destroy, getCurrent, getFrontendMapping, getLastPathParameter, getService, getServletConfig, handleContextOrServletRootWithoutSlash, serveStaticOrWebJarRequest, servletInitialized, whenFrontendMappingAvailable

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, isSensitiveHeader, service

    Methods inherited from class jakarta.servlet.GenericServlet

    getInitParameter, getInitParameterNames, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CdiVaadinServlet

      public CdiVaadinServlet()
  • Method Details

    • init

      public void init(jakarta.servlet.ServletConfig servletConfig) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Servlet
      Overrides:
      init in class com.vaadin.flow.server.VaadinServlet
      Throws:
      jakarta.servlet.ServletException
    • service

      protected void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException
      Overrides:
      service in class com.vaadin.flow.server.VaadinServlet
      Throws:
      jakarta.servlet.ServletException
      IOException
    • getCurrentServletName

      public static String getCurrentServletName()
      Name of the Vaadin servlet for the current thread.

      Until VaadinService appears in CurrentInstance, it have to be used to get the servlet name.

      This method is meant for internal use only.

      Returns:
      currently processing vaadin servlet name
      See Also:
      • VaadinServlet.getCurrent()
    • createServletService

      protected com.vaadin.flow.server.VaadinServletService createServletService(com.vaadin.flow.function.DeploymentConfiguration configuration) throws com.vaadin.flow.server.ServiceException
      Overrides:
      createServletService in class com.vaadin.flow.server.VaadinServlet
      Throws:
      com.vaadin.flow.server.ServiceException