Class NoResourceFoundException

java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.servlet.resource.NoResourceFoundException
All Implemented Interfaces:
Serializable, org.springframework.web.ErrorResponse

public class NoResourceFoundException extends ServletException implements org.springframework.web.ErrorResponse
Raised when ResourceHttpRequestHandler can not find a resource.
Since:
6.1
Author:
Rossen Stoyanchev
See Also:
  • Constructor Details

    • NoResourceFoundException

      public NoResourceFoundException(org.springframework.http.HttpMethod httpMethod, String resourcePath)
      Create an instance.
  • Method Details

    • getHttpMethod

      public org.springframework.http.HttpMethod getHttpMethod()
      Return the HTTP method for the request.
    • getResourcePath

      public String getResourcePath()
      Return the path used to locate the resource.
      See Also:
    • getStatusCode

      public org.springframework.http.HttpStatusCode getStatusCode()
      Specified by:
      getStatusCode in interface org.springframework.web.ErrorResponse
    • getBody

      public org.springframework.http.ProblemDetail getBody()
      Specified by:
      getBody in interface org.springframework.web.ErrorResponse