spring-framework / org.springframework.web.context.support / ServletRequestHandledEvent

ServletRequestHandledEvent

open class ServletRequestHandledEvent : RequestHandledEvent

Servlet-specific subclass of RequestHandledEvent, adding servlet-specific context information.

Author
Juergen Hoeller

Since
2.0

See Also
org.springframework.web.servlet.FrameworkServletorg.springframework.context.ApplicationContext#publishEvent

Constructors

<init>

ServletRequestHandledEvent(source: Any, requestUrl: String, clientAddress: String, method: String, servletName: String, sessionId: String, userName: String, processingTimeMillis: Long)
ServletRequestHandledEvent(source: Any, requestUrl: String, clientAddress: String, method: String, servletName: String, sessionId: String, userName: String, processingTimeMillis: Long, failureCause: Throwable)
ServletRequestHandledEvent(source: Any, requestUrl: String, clientAddress: String, method: String, servletName: String, sessionId: String, userName: String, processingTimeMillis: Long, failureCause: Throwable, statusCode: Int)

Create a new ServletRequestHandledEvent.

Functions

getClientAddress

open fun getClientAddress(): String

Return the IP address that the request came from.

getDescription

open fun getDescription(): String

getMethod

open fun getMethod(): String

Return the HTTP method of the request (usually GET or POST).

getRequestUrl

open fun getRequestUrl(): String

Return the URL of the request.

getServletName

open fun getServletName(): String

Return the name of the servlet that handled the request.

getShortDescription

open fun getShortDescription(): String

getStatusCode

open fun getStatusCode(): Int

Return the HTTP status code of the response or -1 if the status code is not available.

toString

open fun toString(): String

Inherited Functions

getFailureCause

open fun getFailureCause(): Throwable

Return the cause of failure, if any.

getProcessingTimeMillis

open fun getProcessingTimeMillis(): Long

Return the processing time of the request in milliseconds.

getSessionId

open fun getSessionId(): String

Return the id of the HTTP session, if any.

getUserName

open fun getUserName(): String

Return the name of the user that was associated with the request (usually the UserPrincipal).

wasFailure

open fun wasFailure(): Boolean

Return whether the request failed.