Top Description Fields Constructors Methods
org.springframework.web.context.support

public Class ServletRequestHandledEvent

extends RequestHandledEvent
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
org.springframework.lang.Nullable

Servlet-specific subclass of RequestHandledEvent, adding servlet-specific context information.
Author
Juergen Hoeller
Since
2.0
See Also
org.springframework.web.servlet.FrameworkServlet, org.springframework.context.ApplicationContext#publishEvent

Field Summary

Modifier and TypeField and Description
private final String
clientAddress

IP address that the request came from.

private final String
method

Usually GET or POST.

private final String
requestUrl

URL that triggered the request.

private final String
servletName

Name of the servlet that handled the request.

private final int
statusCode

HTTP status code of the response.

Constructor Summary

AccessConstructor and Description
public
ServletRequestHandledEvent(Object
the component that published the event
source
,
String
the URL of the request
requestUrl
,
String
the IP address that the request came from
clientAddress
,
String
the HTTP method of the request (usually GET or POST)
method
,
String
the name of the servlet that handled the request
servletName
,
String
the id of the HTTP session, if any
sessionId
,
String
the name of the user that was associated with the request, if any (usually the UserPrincipal)
userName
,
long
the processing time of the request in milliseconds
processingTimeMillis
)

Create a new ServletRequestHandledEvent.

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

Create a new ServletRequestHandledEvent.

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

Create a new ServletRequestHandledEvent.

Method Summary

Modifier and TypeMethod and Description
public String
getClientAddress()

Return the IP address that the request came from.

public String
getDescription()

Overrides org.springframework.web.context.support.RequestHandledEvent.getDescription.

Return a full description of this event, involving all available context data.

public String
getMethod()

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

public String
getRequestUrl()

Return the URL of the request.

public String
getServletName()

Return the name of the servlet that handled the request.

public String
getShortDescription()

Overrides org.springframework.web.context.support.RequestHandledEvent.getShortDescription.

Return a short description of this event, only involving the most important context data.

public int
getStatusCode()

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

public String
toString()

Overrides org.springframework.web.context.support.RequestHandledEvent.toString.

Returns a String representation of this EventObject.

Inherited from org.springframework.web.context.support.RequestHandledEvent:
getFailureCausegetProcessingTimeMillisgetSessionIdgetUserNamewasFailure

Field Detail

clientAddressback to summary
private final String clientAddress

IP address that the request came from.

methodback to summary
private final String method

Usually GET or POST.

requestUrlback to summary
private final String requestUrl

URL that triggered the request.

servletNameback to summary
private final String servletName

Name of the servlet that handled the request.

statusCodeback to summary
private final int statusCode

HTTP status code of the response.

Constructor Detail

ServletRequestHandledEventback to summary
public ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, String sessionId, String userName, long processingTimeMillis)

Create a new ServletRequestHandledEvent.

Parameters
source:Object

the component that published the event

requestUrl:String

the URL of the request

clientAddress:String

the IP address that the request came from

method:String

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

servletName:String

the name of the servlet that handled the request

sessionId:String

the id of the HTTP session, if any

userName:String

the name of the user that was associated with the request, if any (usually the UserPrincipal)

processingTimeMillis:long

the processing time of the request in milliseconds

ServletRequestHandledEventback to summary
public ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, String sessionId, String userName, long processingTimeMillis, Throwable failureCause)

Create a new ServletRequestHandledEvent.

Parameters
source:Object

the component that published the event

requestUrl:String

the URL of the request

clientAddress:String

the IP address that the request came from

method:String

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

servletName:String

the name of the servlet that handled the request

sessionId:String

the id of the HTTP session, if any

userName:String

the name of the user that was associated with the request, if any (usually the UserPrincipal)

processingTimeMillis:long

the processing time of the request in milliseconds

failureCause:Throwable

the cause of failure, if any

ServletRequestHandledEventback to summary
public ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, String sessionId, String userName, long processingTimeMillis, Throwable failureCause, int statusCode)

Create a new ServletRequestHandledEvent.

Parameters
source:Object

the component that published the event

requestUrl:String

the URL of the request

clientAddress:String

the IP address that the request came from

method:String

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

servletName:String

the name of the servlet that handled the request

sessionId:String

the id of the HTTP session, if any

userName:String

the name of the user that was associated with the request, if any (usually the UserPrincipal)

processingTimeMillis:long

the processing time of the request in milliseconds

failureCause:Throwable

the cause of failure, if any

statusCode:int

the HTTP status code of the response

Method Detail

getClientAddressback to summary
public String getClientAddress()

Return the IP address that the request came from.

getDescriptionback to summary
public String getDescription()

Overrides org.springframework.web.context.support.RequestHandledEvent.getDescription.

Doc from org.springframework.web.context.support.RequestHandledEvent.getDescription.

Return a full description of this event, involving all available context data.

Annotations
@Override
getMethodback to summary
public String getMethod()

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

getRequestUrlback to summary
public String getRequestUrl()

Return the URL of the request.

getServletNameback to summary
public String getServletName()

Return the name of the servlet that handled the request.

getShortDescriptionback to summary
public String getShortDescription()

Overrides org.springframework.web.context.support.RequestHandledEvent.getShortDescription.

Doc from org.springframework.web.context.support.RequestHandledEvent.getShortDescription.

Return a short description of this event, only involving the most important context data.

Annotations
@Override
getStatusCodeback to summary
public int getStatusCode()

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

Since
4.1
toStringback to summary
public String toString()

Overrides org.springframework.web.context.support.RequestHandledEvent.toString.

Doc from java.util.EventObject.toString.

Returns a String representation of this EventObject.

Returns:String

a String representation of this EventObject

Annotations
@Override