Class ServletRequestHandledEvent

All Implemented Interfaces:
Serializable

public class ServletRequestHandledEvent extends RequestHandledEvent
Servlet-specific subclass of RequestHandledEvent, adding servlet-specific context information.
Since:
2.0
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • ServletRequestHandledEvent

      public ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, @Nullable String sessionId, @Nullable String userName, long processingTimeMillis)
      Create a new ServletRequestHandledEvent.
      Parameters:
      source - the component that published the event
      requestUrl - the URL of the request
      clientAddress - the IP address that the request came from
      method - the HTTP method of the request (usually GET or POST)
      servletName - the name of the servlet that handled the request
      sessionId - the id of the HTTP session, if any
      userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
      processingTimeMillis - the processing time of the request in milliseconds
    • ServletRequestHandledEvent

      public ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, @Nullable String sessionId, @Nullable String userName, long processingTimeMillis, @Nullable Throwable failureCause)
      Create a new ServletRequestHandledEvent.
      Parameters:
      source - the component that published the event
      requestUrl - the URL of the request
      clientAddress - the IP address that the request came from
      method - the HTTP method of the request (usually GET or POST)
      servletName - the name of the servlet that handled the request
      sessionId - the id of the HTTP session, if any
      userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
      processingTimeMillis - the processing time of the request in milliseconds
      failureCause - the cause of failure, if any
    • ServletRequestHandledEvent

      public ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, @Nullable String sessionId, @Nullable String userName, long processingTimeMillis, @Nullable Throwable failureCause, int statusCode)
      Create a new ServletRequestHandledEvent.
      Parameters:
      source - the component that published the event
      requestUrl - the URL of the request
      clientAddress - the IP address that the request came from
      method - the HTTP method of the request (usually GET or POST)
      servletName - the name of the servlet that handled the request
      sessionId - the id of the HTTP session, if any
      userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
      processingTimeMillis - the processing time of the request in milliseconds
      failureCause - the cause of failure, if any
      statusCode - the HTTP status code of the response
  • Method Details

    • getRequestUrl

      public String getRequestUrl()
      Return the URL of the request.
    • getClientAddress

      public String getClientAddress()
      Return the IP address that the request came from.
    • getMethod

      public String getMethod()
      Return the HTTP method of the request (usually GET or POST).
    • getServletName

      public String getServletName()
      Return the name of the servlet that handled the request.
    • getStatusCode

      public int getStatusCode()
      Return the HTTP status code of the response or -1 if the status code is not available.
      Since:
      4.1
    • getShortDescription

      public String getShortDescription()
      Description copied from class: RequestHandledEvent
      Return a short description of this event, only involving the most important context data.
      Overrides:
      getShortDescription in class RequestHandledEvent
    • getDescription

      public String getDescription()
      Description copied from class: RequestHandledEvent
      Return a full description of this event, involving all available context data.
      Overrides:
      getDescription in class RequestHandledEvent
    • toString

      public String toString()
      Overrides:
      toString in class RequestHandledEvent