Class XServletHandlerOPTIONS

  • All Implemented Interfaces:
    IXServletBasicHandler, IXServletHandler

    public class XServletHandlerOPTIONS
    extends Object
    implements IXServletHandler
    Called by the server (via the service method) to allow a servlet to handle a OPTIONS request. An OPTIONS request returns the allowed HTTP methods supported by the servlet in the ALLOW HTTP response header.
    Since:
    9.0.0
    Author:
    Philip Helger
    • Constructor Detail

      • XServletHandlerOPTIONS

        public XServletHandlerOPTIONS​(@Nonnull
                                      com.helger.commons.functional.ISupplier<String> aAllowProvider)
        Constructor
        Parameters:
        aAllowProvider - The supplier to use. Must be a supplier, because the underlying "Allow" string can change at runtime!
    • Method Detail

      • getAllowValueProvider

        @Nonnull
        public final com.helger.commons.functional.ISupplier<String> getAllowValueProvider()
        Returns:
        The value supplier passed in the constructor.
        Since:
        9.3.2
      • onRequest

        public void onRequest​(@Nonnull
                              javax.servlet.http.HttpServletRequest aHttpRequest,
                              @Nonnull
                              javax.servlet.http.HttpServletResponse aHttpResponse,
                              @Nonnull
                              com.helger.http.EHttpVersion eHTTPVersion,
                              @Nonnull
                              com.helger.commons.http.EHttpMethod eHTTPMethod,
                              @Nonnull
                              com.helger.web.scope.IRequestWebScope aRequestScope)
                       throws javax.servlet.ServletException,
                              IOException
        Description copied from interface: IXServletHandler
        Handle the servlet action for a certain request and response.
        Specified by:
        onRequest in interface IXServletHandler
        Parameters:
        aHttpRequest - HTTP servlet request. Never null.
        aHttpResponse - HTTP servlet response. Never null.
        eHTTPVersion - HTTP version. Never null.
        eHTTPMethod - HTTP method. Never null.
        aRequestScope - Request scope. Never null.
        Throws:
        javax.servlet.ServletException - On business error
        IOException - On IO error