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 -
Method Summary
Modifier and TypeMethodDescriptionlonggetLastModified(jakarta.servlet.http.HttpServletRequest request) Processes request HTTPGET if-modified-sincemethodsReturns a short description of the servlet.voidinitializedService(jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext.voidonDocumentEvent(DocumentEvent event) Observe document events via CDIvoidstatic voidputInCache(int nDocumentId, int nAttributeId) Put the file in cacheMethods inherited from class jakarta.servlet.http.HttpServlet
init, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
-
Constructor Details
-
DocumentResourceServlet
public DocumentResourceServlet()
-
-
Method Details
-
getLastModified
public long getLastModified(jakarta.servlet.http.HttpServletRequest request) Processes request HTTPGET if-modified-sincemethods- 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 idnAttributeId- The attribut id
-
getServletInfo
Returns a short description of the servlet.- Specified by:
getServletInfoin interfacejakarta.servlet.Servlet- Overrides:
getServletInfoin classjakarta.servlet.GenericServlet- Returns:
- message
-
onDocumentEvent
Observe document events via CDI- Parameters:
event- The document event- Throws:
DocumentException- if error occurs
-
processDocumentEvent
- Throws:
DocumentException
-
initializedService
public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext. It ensures that this CDI beans are instantiated at the application startup.This method is triggered automatically by CDI when the
ApplicationScopedcontext is initialized, which typically occurs during the startup of the application server.- Parameters:
context- theServletContextthat is initialized. This parameter is observed and injected automatically by CDI when theApplicationScopedcontext is initialized.
-