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:rest.TorneoRestController.java

@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public ResponseEntity<?> modificarTorneo(@PathVariable int id, @RequestBody Torneo t) {
    logicaTorneo.modificarTorneo(t, id);
    return new ResponseEntity<>(HttpStatus.CREATED);
}

From source file:com.bradley.musicapp.presentation.rest.PersonRestController.java

@RequestMapping(value = "update", method = RequestMethod.PUT)
@ResponseBody/*from w  w  w . j  a  v  a2  s  . c om*/
public String update(@RequestBody Person person) {
    personService.merge(person);

    System.out.println(" Update Called ");
    return "";
}

From source file:no.dusken.momus.controller.NoteController.java

@RequestMapping(method = RequestMethod.PUT)
public @ResponseBody Note saveNoteForLoggedInUser(@RequestBody Note note) {
    return noteService.saveNoteForLoggedInUser(note);
}

From source file:za.co.dwarfsun.jcmanager.presentation.rest.JobAttachmentRestController.java

@RequestMapping(value = "update", method = RequestMethod.PUT)
@ResponseBody//from  w  w w  . j a v  a2  s .c  o m
public String update(@RequestBody JobAttachment jobAttachment) {
    jobAttachmentService.merge(jobAttachment);
    return "JobAttachment: " + jobAttachment.getFilePath() + " updated...";
}

From source file:tp.project.trafficviolationsystem.presentation.rest.OfficerRestController.java

@RequestMapping(value = "update", method = RequestMethod.PUT)
@ResponseBody/*from w w w .  j av a  2  s. c o  m*/
public String updateOfficer(@RequestBody Officer officer) {
    officerRepository.save(officer);
    return "Fine Updated";
}

From source file:za.co.dwarfsun.jcmanager.presentation.rest.ContactPersonRestController.java

@RequestMapping(value = "update", method = RequestMethod.PUT)
@ResponseBody//from   w  w w  . j  a v a  2s . com
public String update(@RequestBody ContactPerson contactPerson) {
    contactPersonService.merge(contactPerson);
    return "ContactPerson: " + contactPerson.getDescription() + " updated...";
}

From source file:com.br.helpdesk.controller.UserController.java

@RequestMapping(value = { "", "/{id}" }, method = { RequestMethod.PUT, RequestMethod.POST })
@ResponseBody/* www . ja v  a2 s .  c  o m*/
public User save(@RequestBody User user) {
    user = userService.save(user);
    return user;

}

From source file:br.unicesumar.escoladeti2015base.cores.CorController.java

@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public void atualizarCor(@PathVariable String id, @RequestBody Cor cor) {
    service.remove(id);
    service.save(cor);
}

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

@RequestMapping(method = RequestMethod.PUT)
@PreAuthorize("hasRole('ROLE_ADMIN')")
public String update(@Valid MetahivePreferences metahivePreferences, BindingResult bindingResult, Model uiModel,
        HttpServletRequest request) {//from  w ww  .ja v  a  2s . c  o m

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

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

        return "preferences/update";
    }

    uiModel.asMap().clear();
    if (metahivePreferences.getId() != null) {
        // Updating existing preferences
        metahivePreferences.merge();
    } else {
        // No preferences exist yet
        metahivePreferences.persist();
        metahivePreferences.flush();
    }
    FlashScope.appendMessage(getMessage("metahive_preferences_edited"), request);

    return "redirect:/preferences";
}

From source file:com.dynatrace.cf.servicebroker.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);
    String planId = bindingRequest.getPlanId();
    DynatracePlan plan = CatalogFactory.getAssociatedPlanById(planId);
    System.out.println("Plan Id: " + planId + " and the plan is : " + plan);
    return new BindingResponse(new Credentials(plan.getEnvironmentid(), plan.getApitoken(), plan.getApiurl()),
            null);/*w w  w.j  a va 2  s .  c o m*/
}