List of usage examples for org.springframework.web.bind.annotation RequestMethod PUT
RequestMethod PUT
To view the source code for org.springframework.web.bind.annotation RequestMethod PUT.
Click Source Link
From source file:de.msg.controller.RouteController.java
@RequestMapping(value = "{id}", method = RequestMethod.PUT) @PreAuthorize("isAuthenticated() and hasPermission('de.msg.domain.route.Route', 'read')") public ResponseEntity<Route> put(@Valid @RequestBody Route entity) { return ResponseEntity.ok(service.save(entity)); }
From source file:com.tamnd2.basicwebapp.rest.mvc.BlogEntryController.java
@RequestMapping(value = "/{blogEntryId}", method = RequestMethod.PUT) public ResponseEntity<BlogEntryResource> updateBlogEntry(@PathVariable Long blogEntryId, @RequestBody BlogEntryResource sentBlogEntry) { BlogEntry updatedEntry = service.updateBlogEntry(blogEntryId, sentBlogEntry.toBlogEntry()); if (updatedEntry != null) { BlogEntryResource res = new BlogEntryResourceAsm().toResource(updatedEntry); return new ResponseEntity<BlogEntryResource>(res, HttpStatus.OK); } else {/*from w ww .ja v a 2 s . c om*/ return new ResponseEntity<BlogEntryResource>(HttpStatus.NOT_FOUND); } }
From source file:gr.abiss.calipso.controller.ReadOnlyServiceBasedRestController.java
@Override @RequestMapping(value = "{id}", method = RequestMethod.PUT) @ResponseBody// ww w .j av a 2 s.co m public T update(ID id, T resource) { throw new NotImplementedClientException("Method is unsupported."); }
From source file:co.utb.softeng.contactsapp.controllers.ContactsController.java
@RequestMapping(value = { "/", "" }, method = RequestMethod.PUT) public @ResponseBody Contact updateContact(@RequestBody Contact contact) { contactService.saveOrUpdateContact(contact); return contact; }
From source file:de.sainth.recipe.backend.rest.controller.UnitController.java
@Secured("ROLE_ADMIN") @RequestMapping(value = "{shortname}", method = RequestMethod.PUT) HttpEntity<Unit> update(@PathVariable("shortname") String shortname, @Valid @RequestBody Unit unit) { if (shortname.equals(unit.getShortname())) { if (repository.findOne(unit.getShortname()) != null) { repository.save(unit);// w w w .ja va 2 s . c om return new ResponseEntity<>(unit, HttpStatus.OK); } } return new ResponseEntity<>(HttpStatus.BAD_REQUEST); }
From source file:com.nebhale.cyclinglibrary.web.CollectionController.java
@RequestMapping(method = RequestMethod.PUT, value = "/{collectionId}", consumes = ApplicationMediaType.COLLECTION_VALUE, produces = ApplicationMediaType.COLLECTION_VALUE) @ResponseBody//from w w w . j a va2 s .c o m Collection update(@PathVariable Long collectionId, @RequestBody CollectionInput collectionInput) { return this.collectionRepository.update(collectionId, collectionInput.getName(), collectionInput.getShortName()); }
From source file:net.smktarunabhakti.penjualan.ui.controller.BarangController.java
@RequestMapping(method = RequestMethod.PUT, value = "/barang/{id}") @ResponseStatus(HttpStatus.OK)/*from w w w . j ava2 s. c om*/ public void update(@PathVariable String id, @RequestBody @Valid Barang b) { Barang barang = appService.cariBarangById(id); if (barang == null) { throw new IllegalStateException(); } b.setId(barang.getId()); appService.simpanBarang(b); }
From source file:com.tsg.cms.BlogPostController.java
@RequestMapping(value = "/blogPost/{id}", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.CREATED)//from ww w . ja v a 2s . co m @ResponseBody public BlogPostContainer updateBlogPost(@PathVariable("id") int id, @RequestBody BlogPost blogPost) { blogPost.setPostId(id); return blogPostDao.updateBlogPost(blogPost); }
From source file:com.expedia.seiso.web.controller.v1.NodeIpAddressControllerV1.java
@RequestMapping(value = NODE_IP_ADDRESS_URI_TEMPLATE, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.NO_CONTENT)/* www .j ava 2s.com*/ public void put(@PathVariable String nodeName, @PathVariable String ipAddress, PEResource nipResource) { val node = nodeRepo.findByName(nodeName); val serviceInstance = node.getServiceInstance(); // Enrich the node IP address so we can save it. [WLW] val nipData = (NodeIpAddress) nipResource.getItem(); nipData.setNode(node); nipData.setIpAddress(ipAddress); nipData.getIpAddressRole().setServiceInstance(serviceInstance); basicItemDelegate.put(nipData, true); }
From source file:net.anthonychaves.bookmarks.web.BookmarkController.java
@RequestMapping(method = RequestMethod.PUT) public String updateBookmark(@RequestParam(value = "id") Integer id, @RequestParam(value = "tags") String tags, HttpSession session, ModelMap model) { User user = (User) session.getAttribute("user"); Object[] userBookmark = bookmarkService.updateTags(user, id, tags.replaceAll("\\s", ",")); System.out.println("tags:" + tags.replaceAll("\\s", ",")); user = (User) userBookmark[0];/*from w w w . ja va 2s .c o m*/ Bookmark bookmark = (Bookmark) userBookmark[1]; List<String> deletedTags = (List<String>) userBookmark[2]; tagService.addTags(bookmark); for (String t : deletedTags) { if (t.length() > 0) { tagService.deleteBookmarkFromTag(bookmark, t); } } BookmarkDetail b = new BookmarkDetail(bookmark.getId(), bookmark.getTitle(), bookmark.getUrl(), bookmark.getTags()); model.clear(); model.addAttribute("bookmark", b); session.setAttribute("user", user); return "add_bookmark_success"; }