类 ServletRequestHandledEvent
- java.lang.Object
- java.util.EventObject
- org.springframework.context.ApplicationEvent
- org.springframework.web.context.support.RequestHandledEvent
- org.springframework.web.context.support.ServletRequestHandledEvent
- 所有已实现的接口:
Serializable
public class ServletRequestHandledEvent extends RequestHandledEvent
Servlet-specific subclass of RequestHandledEvent, adding servlet-specific context information.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller
- 另请参阅:
FrameworkServlet
,ApplicationEventPublisher.publishEvent(org.springframework.context.ApplicationEvent)
, 序列化表格
字段概要
从类继承的字段 java.util.EventObject
source
构造器概要
构造器 构造器 说明 ServletRequestHandledEvent(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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getClientAddress()
Return the IP address that the request came from.String
getDescription()
Return a full description of this event, involving all available context data.String
getMethod()
Return the HTTP method of the request (usually GET or POST).String
getRequestUrl()
Return the URL of the request.String
getServletName()
Return the name of the servlet that handled the request.String
getShortDescription()
Return a short description of this event, only involving the most important context data.int
getStatusCode()
Return the HTTP status code of the response or -1 if the status code is not available.String
toString()
从类继承的方法 org.springframework.web.context.support.RequestHandledEvent
getFailureCause, getProcessingTimeMillis, getSessionId, getUserName, wasFailure
从类继承的方法 org.springframework.context.ApplicationEvent
getTimestamp
从类继承的方法 java.util.EventObject
getSource
构造器详细资料
ServletRequestHandledEvent
public ServletRequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String servletName, String sessionId, String userName, long processingTimeMillis)
Create a new ServletRequestHandledEvent.- 参数:
source
- the component that published the eventrequestUrl
- the URL of the requestclientAddress
- the IP address that the request came frommethod
- the HTTP method of the request (usually GET or POST)servletName
- the name of the servlet that handled the requestsessionId
- the id of the HTTP session, if anyuserName
- 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, String sessionId, String userName, long processingTimeMillis, Throwable failureCause)
Create a new ServletRequestHandledEvent.- 参数:
source
- the component that published the eventrequestUrl
- the URL of the requestclientAddress
- the IP address that the request came frommethod
- the HTTP method of the request (usually GET or POST)servletName
- the name of the servlet that handled the requestsessionId
- the id of the HTTP session, if anyuserName
- the name of the user that was associated with the request, if any (usually the UserPrincipal)processingTimeMillis
- the processing time of the request in millisecondsfailureCause
- the cause of failure, if any
ServletRequestHandledEvent
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.- 参数:
source
- the component that published the eventrequestUrl
- the URL of the requestclientAddress
- the IP address that the request came frommethod
- the HTTP method of the request (usually GET or POST)servletName
- the name of the servlet that handled the requestsessionId
- the id of the HTTP session, if anyuserName
- the name of the user that was associated with the request, if any (usually the UserPrincipal)processingTimeMillis
- the processing time of the request in millisecondsfailureCause
- the cause of failure, if anystatusCode
- the HTTP status code of the response
方法详细资料
getRequestUrl
public String getRequestUrl()
Return the URL of the request.
getClientAddress
public String getClientAddress()
Return the IP address that the request came from.
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.- 从以下版本开始:
- 4.1
getShortDescription
public String getShortDescription()
从类复制的说明:RequestHandledEvent
Return a short description of this event, only involving the most important context data.
getDescription
public String getDescription()
从类复制的说明:RequestHandledEvent
Return a full description of this event, involving all available context data.
toString
public String toString()
- 覆盖:
toString
在类中RequestHandledEvent