Class ServletRequestHandledEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.web.context.support.RequestHandledEvent
org.springframework.web.context.support.ServletRequestHandledEvent
- All Implemented Interfaces:
- Serializable
Servlet-specific subclass of RequestHandledEvent,
 adding servlet-specific context information.
- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, String sessionId, String userName, long processingTimeMillis) Create a new ServletRequestHandledEvent.ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, String sessionId, String userName, long processingTimeMillis, Throwable failureCause) Create a new ServletRequestHandledEvent.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.
- 
Method SummaryModifier and TypeMethodDescriptionReturn the IP address that the request came from.Return a full description of this event, involving all available context data.Return the HTTP method of the request (usually GET or POST).Return the URL of the request.Return the name of the servlet that handled the request.Return a short description of this event, only involving the most important context data.intReturn the HTTP status code of the response or -1 if the status code is not available.toString()Methods inherited from class org.springframework.web.context.support.RequestHandledEventgetFailureCause, getProcessingTimeMillis, getSessionId, getUserName, wasFailureMethods inherited from class org.springframework.context.ApplicationEventgetTimestampMethods inherited from class java.util.EventObjectgetSource
- 
Constructor Details- 
ServletRequestHandledEventpublic 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
 
- 
ServletRequestHandledEventpublic 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
 
- 
ServletRequestHandledEventpublic 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- 
getRequestUrlReturn the URL of the request.
- 
getClientAddressReturn the IP address that the request came from.
- 
getMethodReturn the HTTP method of the request (usually GET or POST).
- 
getServletNameReturn the name of the servlet that handled the request.
- 
getStatusCodepublic int getStatusCode()Return the HTTP status code of the response or -1 if the status code is not available.- Since:
- 4.1
 
- 
getShortDescriptionDescription copied from class:RequestHandledEventReturn a short description of this event, only involving the most important context data.- Overrides:
- getShortDescriptionin class- RequestHandledEvent
 
- 
getDescriptionDescription copied from class:RequestHandledEventReturn a full description of this event, involving all available context data.- Overrides:
- getDescriptionin class- RequestHandledEvent
 
- 
toString- Overrides:
- toStringin class- RequestHandledEvent
 
 
-