Example usage for org.springframework.http HttpStatus NOT_FOUND

List of usage examples for org.springframework.http HttpStatus NOT_FOUND

Introduction

In this page you can find the example usage for org.springframework.http HttpStatus NOT_FOUND.

Prototype

HttpStatus NOT_FOUND

To view the source code for org.springframework.http HttpStatus NOT_FOUND.

Click Source Link

Document

404 Not Found .

Usage

From source file:org.grails.datastore.mapping.riak.util.Ignore404sErrorHandler.java

@Override
protected boolean hasError(HttpStatus statusCode) {
    if (statusCode != HttpStatus.NOT_FOUND) {
        return super.hasError(statusCode);
    }//from  ww w  . j av  a2  s.com
    return false;
}

From source file:org.test.skeleton.controller.SecurityControllerAdvice.java

@ExceptionHandler(AccessDeniedException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public void forbidden(AccessDeniedException denied) {
    logger.debug(denied);
}

From source file:net.eusashead.hateoas.springhalbuilder.controller.ExceptionHandlingControllerAdvice.java

@ExceptionHandler(ObjectRetrievalFailureException.class)
public ResponseEntity<Void> handleNotFound() {
    return new ResponseEntity<Void>(HttpStatus.NOT_FOUND);
}

From source file:io.kahu.hawaii.util.exception.FeatureNotEnabledException.java

@Override
public HttpStatus getStatus() {
    return HttpStatus.NOT_FOUND;
}

From source file:com.create.controller.ErrorController.java

@RequestMapping(value = "/error/404", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.NOT_FOUND)
public String showNotFound() {
    return NOT_FOUND_TEMPLATE;
}

From source file:de.hska.ld.core.exception.NotFoundException.java

public NotFoundException(String field) {
    super(field, "NOT_FOUND");
    httpStatus = HttpStatus.NOT_FOUND;
}

From source file:org.cloudfoundry.maven.Stop.java

@Override
protected void doExecute() throws MojoExecutionException {

    getLog().info(String.format("Stopping application '%s'", getAppname()));

    try {/* w  ww  .j  av  a2 s . co  m*/
        getClient().stopApplication(getAppname());
    } catch (CloudFoundryException e) {
        if (HttpStatus.NOT_FOUND.equals(e.getStatusCode())) {
            throw new MojoExecutionException(String.format("Application '%s' does not exist", getAppname()), e);
        }
    }
}

From source file:com.dhenton9000.birt.BirtApplication.java

@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
    return (container -> {

        ErrorPage custom404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404");
        container.addErrorPages(custom404Page);

    });//from w ww.  j  av a 2 s. com
}

From source file:com.ar.dev.tierra.api.controller.ChartController.java

@RequestMapping(value = "/vendedor/cantidad", method = RequestMethod.GET)
public ResponseEntity<?> getRowCountVendedor(@RequestParam("idVendedor") int idVendedor) {
    List<Chart> chart = impl.getVentaVendedores(idVendedor);
    if (!chart.isEmpty()) {
        return new ResponseEntity<>(chart, HttpStatus.OK);
    } else {/*from w  w  w.ja  v a  2  s .co m*/
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }
}

From source file:com.sms.server.controller.JobController.java

@RequestMapping(value = "/active", method = RequestMethod.GET)
public ResponseEntity<List<Job>> getActiveJobs() {
    List<Job> jobs = jobDao.getActiveJobs();

    if (jobs == null) {
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }// ww w.j  a v a2s. co m

    return new ResponseEntity<>(jobs, HttpStatus.OK);
}