Example usage for org.springframework.http HttpStatus OK

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

Introduction

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

Prototype

HttpStatus OK

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

Click Source Link

Document

200 OK .

Usage

From source file:sample.tomcat.web.DemoController.java

@RequestMapping(value = "/responseEntity", method = RequestMethod.GET)
public ResponseEntity<String> helloWorld() {
    return new ResponseEntity<String>("response from ResponseEntity returning method", HttpStatus.OK);
}

From source file:sample.mvc.SecurityController.java

@RequestMapping(value = "/principal")
public ResponseEntity<User> currentPrincipal(@CurrentUser User currentUser) {
    return new ResponseEntity<User>(currentUser, HttpStatus.OK);
}

From source file:org.echocat.marquardt.example.ExampleServiceController.java

@RequestMapping(value = "/adminResource", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
public void adminResource() throws IOException {
    LOGGER.info("/exampleservice/adminResource received a request");
}

From source file:com.neu.controller.SearchController.java

@RequestMapping(value = "/search.htm", method = RequestMethod.GET, headers = "Accept=*/*", produces = "application/json")
@ResponseStatus(HttpStatus.OK)
public @ResponseBody String searchresult(HttpServletRequest request) throws Exception {
    System.out.println("in drugsearch controller");
    String action = request.getParameter("action");
    List<Drugs> drugs;/*from   w w  w. j a  v  a  2s  .co m*/
    String csvFile = "UserSearch.csv";
    String rpath = request.getRealPath("/");
    rpath = rpath + "/dataFiles/" + csvFile;

    Pattern pattern = Pattern.compile(",");

    BufferedReader in = new BufferedReader(new FileReader(rpath));
    drugs = in.lines().skip(1).map(line -> {
        String[] x = pattern.split(line);
        return new Drugs(x[0], x[3]);
    }).collect(Collectors.toList());
    ObjectMapper mapper = new ObjectMapper();
    mapper.enable(SerializationConfig.Feature.INDENT_OUTPUT);
    mapper.writeValue(System.out, drugs);

    //            Drugs drug=new Drugs("AZ","sn");
    return mapper.writeValueAsString(drugs);
}

From source file:de.thesis.webapi.CarController.java

@RequestMapping(method = RequestMethod.GET, value = "/cars")
@ResponseStatus(HttpStatus.OK)
public CarList readAll() {
    return getCars(); //returns all cars as list in a XML-Document
}

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

@RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getAll() {
    List<MedioPago> list = facadeService.getMedioPagoDAO().getAll();
    if (!list.isEmpty()) {
        return new ResponseEntity<>(list, HttpStatus.OK);
    } else {// ww  w.  j a  va 2s.com
        return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
    }
}

From source file:springfox.documentation.spring.web.dummy.controllers.GenericPetController.java

@PostMapping("test")
public ResponseEntity<Pet> test() {
    return new ResponseEntity(HttpStatus.OK);
}

From source file:com.diagrama.repository.EncuestControl.java

@RequestMapping(value = "/taller", method = RequestMethod.GET)
public ResponseEntity<?> normal() {
    Iterable<Producto> producto = er.findAll();
    return new ResponseEntity<>(producto, HttpStatus.OK);
}

From source file:com.melayer.camzia.controller.MeControllerAdmin.java

@RequestMapping(path = "/check", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
public Callable<ResponseEntity<Map<String, Object>>> checkWebServices() {

    return () -> {

        entityMap.clear();/*from www.ja  v  a 2  s .co  m*/
        entityMap.put("status", "working fine");

        ResponseEntity<Map<String, Object>> entity = new ResponseEntity<>(entityMap, HttpStatus.OK);

        return entity;
    };
}

From source file:am.ik.categolj3.api.entry.EntryFileDownloadController.java

@RequestMapping(path = "new")
ResponseEntity<Resource> download() {
    return ResponseEntity.status(HttpStatus.OK).contentType(MediaType.parseMediaType("text/x-markdown"))
            .body(downloadFile);/*w ww . j  av a 2s .c o m*/
}