Class NoHandlerFoundException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.codename1.backend.web.NoHandlerFoundException

public class NoHandlerFoundException extends RuntimeException
What a @ControllerAdvice @ExceptionHandler receives for a request no route and no static file served, as Spring's NoHandlerFoundException. Handle it to answer such paths yourself -- a JSON 404 for an API client, an HTML page for a browser; with no handler for it the server answers its plain 404 as before. The handler is given a null HandlerMethod, since nothing matched, and an advice restricted by basePackages is never asked.
  • Constructor Details

    • NoHandlerFoundException

      public NoHandlerFoundException(String httpMethod, String requestUrl)
      Parameters:
      httpMethod - the request's method
      requestUrl - the request's path
  • Method Details

    • getHttpMethod

      public String getHttpMethod()
      Returns:
      the request's method
    • getRequestURL

      public String getRequestURL()
      Returns:
      the request's path