Class ErrorCodeRequestHandler

  • All Implemented Interfaces:
    IRequestHandler

    public final class ErrorCodeRequestHandler
    extends java.lang.Object
    implements IRequestHandler
    Response target that is to be used in a servlet environment to send an error code and optionally a message. NOTE: this target can only be used in a servlet environment with IRequestCycles.
    Author:
    Eelco Hillenius
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getErrorCode()
      Gets the servlet error code.
      java.lang.String getMessage()
      Gets the optional message to send to the client.
      void respond​(IRequestCycle requestCycle)
      Respond by sending the set errorCode and optionally the message to the browser.
      • Methods inherited from class java.lang.Object

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

      • ErrorCodeRequestHandler

        public ErrorCodeRequestHandler​(int errorCode)
        Construct.
        Parameters:
        errorCode - the servlet error code; use one of the HttpServletResponse constants
        See Also:
        HttpServletResponse
      • ErrorCodeRequestHandler

        public ErrorCodeRequestHandler​(int errorCode,
                                       java.lang.String message)
        Construct.
        Parameters:
        errorCode - the servlet error code; use one of the HttpServletResponse constants
        message - the optional message to send to the client
        See Also:
        HttpServletResponse
    • Method Detail

      • getErrorCode

        public final int getErrorCode()
        Gets the servlet error code.
        Returns:
        the servlet error code
      • getMessage

        public final java.lang.String getMessage()
        Gets the optional message to send to the client.
        Returns:
        the optional message to send to the client