Example usage for org.springframework.web.bind.annotation RequestMethod PUT

List of usage examples for org.springframework.web.bind.annotation RequestMethod PUT

Introduction

In this page you can find the example usage for org.springframework.web.bind.annotation RequestMethod PUT.

Prototype

RequestMethod PUT

To view the source code for org.springframework.web.bind.annotation RequestMethod PUT.

Click Source Link

Usage

From source file:com.cemeterylistingsweb.presentation.rest.LoginController.java

@RequestMapping(value = "update", method = RequestMethod.PUT) //This the uri e.g http://localhost:8084/askweb/api/club/update
@ResponseBody/*w  w w  .j  a  v a2 s  . co  m*/
public String update(@RequestBody Subscriber sub) {

    cs.merge(sub);
    System.out.println(" Update Called ");
    return "subscriber updated";
}

From source file:net.triptech.metahive.web.PersonController.java

@RequestMapping(method = RequestMethod.PUT)
@PreAuthorize("hasRole('ROLE_ADMIN')")
public String update(@Valid Person person, BindingResult bindingResult, Model uiModel,
        HttpServletRequest request) {/*from  w ww  .  ja  va 2s.  co m*/

    if (bindingResult.hasErrors()) {
        uiModel.addAttribute("person", person);

        FlashScope.appendMessage(getMessage("metahive_object_validation", Person.class), request);

        return "people/update";
    }
    uiModel.asMap().clear();
    person.merge();

    FlashScope.appendMessage(getMessage("metahive_edit_complete", Person.class), request);

    return "redirect:/people";
}

From source file:org.moserp.product.rest.ProductCatalogController.java

@ResponseBody
@RequestMapping(method = RequestMethod.PUT, value = "/{catalogId}/products")
public ResponseEntity<?> updateProducts(@PathVariable String catalogId, @RequestBody List<Product> products) {
    ProductCatalog productCatalog = productCatalogRepository.findOne(catalogId);
    if (productCatalog == null) {
        return ResponseEntity.notFound().build();
    }/*from  ww  w. j a v a  2  s.co  m*/
    for (Product newProduct : products) {
        Product product = productRepository.findByExternalId(newProduct.getExternalId());
        if (product == null) {
            product = newProduct;
        } else {
            domainObjectMerger.merge(newProduct, product, DomainObjectMerger.NullHandlingPolicy.IGNORE_NULLS);
        }
        product.setCatalog(productCatalog);
        productRepository.save(product);
    }
    return ResponseEntity.ok().build();
}

From source file:com.consol.citrus.admin.web.SpringBeanController.java

@RequestMapping(value = "/{id}", method = { RequestMethod.PUT })
@ResponseBody//w  w w . j  a  v a 2  s  . c om
public void updateBean(@PathVariable("id") String id, @RequestBody SpringBean bean) {
    springBeanService.updateBeanDefinition(projectService.getProjectContextConfigFile(),
            projectService.getActiveProject(), id, bean);
}

From source file:com.revze.controller.CatatanController.java

@RequestMapping(method = RequestMethod.PUT)
public void edit(@PathVariable String id, @RequestBody Catatan c) {
    Catatan catatan = catatanDao.findOne(id);
    if (catatan != null) {
        c.setId(id);/*from w w  w .  j a  va 2 s .  co m*/
        catatanDao.save(c);
    }
}

From source file:com.appdynamics.cloudfoundry.appdservicebroker.binding.BindingController.java

@RequestMapping(method = RequestMethod.PUT, value = "/v2/service_instances/*/service_bindings/*")
BindingResponse create(@RequestBody BindingRequest bindingRequest) {
    this.logger.info("Binding Request Received: {}", bindingRequest);
    System.out.println("Binding Request Received: " + bindingRequest);
    return new BindingResponse(this.credentialsHolder.getCredentialsByPlanId(bindingRequest.getPlanId()), null);
}

From source file:net.eusashead.hateoas.conditional.interceptor.SyncTestController.java

@RequestMapping(method = RequestMethod.PUT)
public ResponseEntity<Void> put() {
    HttpHeaders headers = new HttpHeaders();
    headers.setETag("\"123456\"");
    return new ResponseEntity<Void>(headers, HttpStatus.NO_CONTENT);
}

From source file:com.orange.cloud.servicebroker.filter.core.service.ServiceInstanceBindingServiceClient.java

@RequestMapping(value = "/v2/service_instances/{instanceId}/service_bindings/{bindingId}", method = RequestMethod.PUT, produces = {
        MediaType.APPLICATION_JSON_VALUE })
ResponseEntity<CreateServiceInstanceAppBindingResponse> createServiceInstanceBinding(
        @PathVariable("instanceId") String serviceInstanceId, @PathVariable("bindingId") String bindingId,
        @Valid @RequestBody CreateServiceInstanceBindingRequest request);

From source file:com.opensearchserver.hadse.index.IndexController.java

@RequestMapping(method = RequestMethod.PUT, value = "/{index_name}")
@ResponseBody//from  w ww .  j ava 2s  . c o m
public HttpEntity<?> createIndex(@PathVariable String index_name,
        @RequestParam(value = "shards", required = false, defaultValue = "5") Integer shards,
        @RequestParam(value = "replicats", required = false, defaultValue = "1") Integer replicas) {
    try {
        return IndexCatalog.create(index_name, shards, replicas);
    } catch (Throwable e) {
        return new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
    }
}

From source file:com.revze.crudspring.controller.CatatanController.java

@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public void edit(@PathVariable String id, @RequestBody Catatan c) {
    Catatan catatan = catatanDao.findOne(id);
    if (catatan != null) {
        c.setId(id);// ww w  .  j  av a 2s  . co  m
        catatanDao.save(c);
    }
}