类 NoHandlerFoundException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- javax.servlet.ServletException
- org.springframework.web.servlet.NoHandlerFoundException
- 所有已实现的接口:
Serializable
public class NoHandlerFoundException extends ServletException
By default when the DispatcherServlet can't find a handler for a request it sends a 404 response. However if its property "throwExceptionIfNoHandlerFound" is set totruethis exception is raised and may be handled with a configured HandlerExceptionResolver.- 从以下版本开始:
- 4.0
- 作者:
- Brian Clozel
- 另请参阅:
DispatcherServlet.setThrowExceptionIfNoHandlerFound(boolean),DispatcherServlet.noHandlerFound(HttpServletRequest, HttpServletResponse), 序列化表格
构造器概要
构造器 构造器 说明 NoHandlerFoundException(String httpMethod, String requestURL, HttpHeaders headers)Constructor for NoHandlerFoundException.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 HttpHeadersgetHeaders()StringgetHttpMethod()StringgetRequestURL()从类继承的方法 javax.servlet.ServletException
getRootCause
构造器详细资料
NoHandlerFoundException
public NoHandlerFoundException(String httpMethod, String requestURL, HttpHeaders headers)
Constructor for NoHandlerFoundException.- 参数:
httpMethod- the HTTP methodrequestURL- the HTTP request URLheaders- the HTTP request headers
方法详细资料
getHttpMethod
public String getHttpMethod()
getRequestURL
public String getRequestURL()
getHeaders
public HttpHeaders getHeaders()