Class DocumentResourceServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
fr.paris.lutece.plugins.document.web.DocumentResourceServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

@ApplicationScoped @Named("document.documentResourceServlet") public class DocumentResourceServlet extends jakarta.servlet.http.HttpServlet
Servlet serving document file resources
See Also:
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    getLastModified(jakarta.servlet.http.HttpServletRequest request)
    Processes request HTTP GET if-modified-since methods
    Returns a short description of the servlet.
    void
    initializedService(jakarta.servlet.ServletContext context)
    This method observes the initialization of the ApplicationScoped context.
    void
    Observe document events via CDI
    void
    static void
    putInCache(int nDocumentId, int nAttributeId)
    Put the file in cache

    Methods inherited from class jakarta.servlet.http.HttpServlet

    init, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log

    Methods inherited from class java.lang.Object

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

    • DocumentResourceServlet

      public DocumentResourceServlet()
  • Method Details

    • getLastModified

      public long getLastModified(jakarta.servlet.http.HttpServletRequest request)
      Processes request HTTP GET if-modified-since methods
      Parameters:
      request - The HTTP request
      Returns:
      document last modified date
    • putInCache

      public static void putInCache(int nDocumentId, int nAttributeId)
      Put the file in cache
      Parameters:
      nDocumentId - The document id
      nAttributeId - The attribut id
    • getServletInfo

      public String getServletInfo()
      Returns a short description of the servlet.
      Specified by:
      getServletInfo in interface jakarta.servlet.Servlet
      Overrides:
      getServletInfo in class jakarta.servlet.GenericServlet
      Returns:
      message
    • onDocumentEvent

      public void onDocumentEvent(@Observes DocumentEvent event) throws DocumentException
      Observe document events via CDI
      Parameters:
      event - The document event
      Throws:
      DocumentException - if error occurs
    • processDocumentEvent

      public void processDocumentEvent(DocumentEvent event) throws DocumentException
      Throws:
      DocumentException
    • initializedService

      public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context)
      This method observes the initialization of the ApplicationScoped context. It ensures that this CDI beans are instantiated at the application startup.

      This method is triggered automatically by CDI when the ApplicationScoped context is initialized, which typically occurs during the startup of the application server.

      Parameters:
      context - the ServletContext that is initialized. This parameter is observed and injected automatically by CDI when the ApplicationScoped context is initialized.