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:belajar.nfc.controller.EntriTransaksiController.java

@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public void updateEntriTransaksi(@RequestBody EntriTransaksi entriTransaksi) throws Exception {
    if (entriTransaksi == null) {
        throw new Exception("Tidak Boleh Kosong");
    }/*  ww  w  .  ja  v a  2 s  . c  o  m*/
    entriTransaksiDao.save(entriTransaksi);
}

From source file:edu.mayo.cts2.uriresolver.controller.ResolveURI.java

@RequestMapping(method = RequestMethod.PUT, value = "/versions/{type}/{identifier}")
public ResponseEntity<String> saveVersionIdentifiers(@RequestBody UriResults uriResults,
        @PathVariable String type, @PathVariable String identifier) {
    logger.info("\n\nsaveVersionIdentifiers\n\n");
    uriDAO.saveVersionIdentifiers(uriResults);
    logger.info("finshed saving");
    return new ResponseEntity<String>(new HttpHeaders(), HttpStatus.OK);
}

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

@RequestMapping(method = RequestMethod.PUT)
@PreAuthorize("hasRole('ROLE_ADMIN')")
public String update(@Valid ConditionOfUse conditionOfUse, BindingResult bindingResult, Model uiModel,
        HttpServletRequest request) {/*  w w w  .j a v  a  2 s.  c  om*/

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

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

        return "conditions/update";
    }
    uiModel.asMap().clear();
    conditionOfUse.merge();

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

    return "redirect:/lists";
}

From source file:com.github.iexel.fontus.web.rest.ProductsController.java

@RequestMapping(value = "ajax/products/{id}", method = RequestMethod.PUT)
public GridRowResponse updateProduct(@Valid Product product, @PathVariable("id") int productId)
        throws ServiceException {

    product.setId(productId);/*w  w w.j  a v a 2s  . c  o  m*/
    return productsService.updateProduct(product);
}

From source file:com.seabee.snapdragon.controller.BlogController.java

@RequestMapping(value = "/{entryId}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)/*  ww w .  j  a  va2  s.  co  m*/
public void editBlogEntry(@Valid @RequestBody BlogEntry entry, @PathVariable("entryId") int id) {
    entry.setEntryId(id);
    dao.updateBlogEntry(entry);
}

From source file:gg.server.MailController.java

@RequestMapping(method = RequestMethod.PUT)
public ModelAndView handleEmailPut(HttpServletRequest request, HttpServletResponse response) {
    try {/*from  w w w  . j av a 2s. co  m*/
        InputStream inputStream = request.getInputStream();
        if (inputStream != null) {
            log.debug("Got PUT");
            mailer.sendMail(inputStream);
        }
    } catch (IOException e) {
        return errorPage("Failed handling put {}", e);
    } catch (RuntimeException e) {
        return errorPage("Failed sending mail", e);
    }
    return success;
}

From source file:com.artivisi.salary.payroll.system.controller.AbsensiController.java

@RequestMapping(value = "/absensi/{id}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.OK)/*from www. ja  v a2s .  c  om*/
public void update(@PathVariable(value = "id") String id, @RequestBody Absensi a) throws Exception {
    Absensi absensi = absensiService.findOne(id);
    if (absensi == null) {
        throw new Exception("Data tidak ditemukan");
    }
    a.setId(absensi.getId());
    absensiService.save(a);
}

From source file:com.nebhale.cyclinglibrary.web.TypeController.java

@RequestMapping(method = RequestMethod.PUT, value = "/{typeId}", consumes = ApplicationMediaType.TYPE_VALUE, produces = ApplicationMediaType.TYPE_VALUE)
@ResponseBody/*from   w  w w .j  a  v  a 2  s. co  m*/
Type update(@PathVariable Long typeId, @RequestBody TypeInput typeInput) {
    return this.typeRepository.update(typeId, typeInput.getName(), typeInput.getShortName());
}

From source file:org.easy.scrum.service.TeamService.java

@RequestMapping(value = "/teams/{id}", method = RequestMethod.PUT)
@ResponseBody/*from  w w  w . j av  a  2  s  .co m*/
public TeamBE update(@PathVariable Long id, @Valid @RequestBody TeamBE team) {
    team.setId(id);
    team = teamDao.save(team);
    return team;
}

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

@RequestMapping(value = "update", method = RequestMethod.PUT) //This the uri e.g http://localhost:8084/askweb/api/club/update
@ResponseBody//from w ww  .  jav  a 2s  .co m
public String update(@RequestBody Cemetery cemetery) {
    cs.merge(cemetery);
    System.out.println(" Update Called ");
    return "Club Update";
}