List of usage examples for org.springframework.web.bind.annotation RequestMethod POST
RequestMethod POST
To view the source code for org.springframework.web.bind.annotation RequestMethod POST.
Click Source Link
From source file:ui.controller.ItemDatabaseRestController.java
@RequestMapping(method = RequestMethod.POST) public void addUser(@RequestBody User u) { getService().addUser(u); }
From source file:unic.mentoring.jms.ctrl.MessageCtrl.java
@RequestMapping(value = "/message", method = RequestMethod.POST) public String message(Model model, @RequestParam("message") String message, @RequestParam("topic") String topic) { if (!StringUtils.isEmpty(message)) { try {//from w w w .j a va2 s. c o m sendMessage(message, topic); model.addAttribute(ATTR_MESSAGE, "Message (length: " + message.length() + ") has been sent into topic \"" + topic + "\"."); } catch (JMSException e) { model.addAttribute(ATTR_MESSAGE, "Can't send message: " + e.getMessage()); } } else { model.addAttribute(ATTR_MESSAGE, "No message has been specified to send."); } return Constants.Page.INDEX; }
From source file:org.echocat.marquardt.example.ExampleServiceController.java
@RequestMapping(value = "/someUnprotectedResource", method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK)// w ww . j ava2 s . c o m public void someUnprotectedResource() throws IOException { LOGGER.info("/exampleservice/someUnprotectedResource received a request"); }
From source file:controllers.ImpressionFormController.java
@RequestMapping(value = "/form", method = RequestMethod.POST) public String addImpression(@ModelAttribute("impression") Impression impression, ModelMap model) throws ClassNotFoundException { impression.insertImpresion();/*w w w .j av a2 s . c o m*/ createForm(model); return "form"; }
From source file:com.butler.fishcartserver.OrderInformer.java
@RequestMapping(value = "/orders", method = RequestMethod.POST, produces = { "application/json" }) public @ResponseBody List<OrderDetails> getOrderDetails() { return orderDao.getPendingOrders(); }
From source file:com.truthbean.demo.ssm.controller.ViewController.java
@RequestMapping(value = "/{area}.json", method = { RequestMethod.GET, RequestMethod.POST }, produces = "application/json;charset=UTF-8") public EnrollModel getEnrollModelInJSON(@PathVariable String area) { model.setArea(area);// w w w. j a v a2 s . co m model.setYears(new String[] { "2012", "2014" }); return model; }
From source file:com.controller.RandomController.java
@RequestMapping(value = "getUser.htm", method = RequestMethod.POST) public @ResponseBody String getUser(@RequestParam(value = "first") String first, @RequestParam(value = "last") String last) { // System.out.println(first+" "+last); return first + " " + last; }
From source file:com.example.security.UserController.java
@RequestMapping(value = "/user", method = RequestMethod.POST, consumes = "application/json") public @ResponseBody User addUser(@RequestBody UserDTO user) { return userDetailsService.addUser(new User(user.getUsername(), user.getPassword(), user.getRoles())); }
From source file:wad.controller.TechreportController.java
@RequestMapping(method = RequestMethod.POST) public String createTechreport(@ModelAttribute Techreport techreport, RedirectAttributes redirectAttributes) { techreportService.addTechreport(techreport); redirectAttributes.addAttribute("id", techreport.getId()); redirectAttributes.addFlashAttribute("message", "New techreport created"); return "redirect:/techreports/{id}/bibtex"; }
From source file:com.tsg.sitemapwebappmvc.controller.FlooringCalcController.java
@RequestMapping(value = "/FlooringCalcController", method = RequestMethod.POST) public String getFlooringCalcResults(HttpServletRequest request, Model model) { String newWidth = request.getParameter("width"); Double width = Double.parseDouble(newWidth); String newLength = request.getParameter("length"); Double length = Double.parseDouble(newLength); String newCost = request.getParameter("costSqFt"); Double costPerSqFt = Double.parseDouble(newCost); FlooringCalculator floorCalc = new FlooringCalculator(width, length, costPerSqFt); double newArea = floorCalc.getArea(width, length); double newMatCost = floorCalc.getMateialCost(newArea, costPerSqFt); double newLaborCost = floorCalc.getLaborRate(); double newTotal = floorCalc.getOrderTotal(newLaborCost, newMatCost); double totalTime = newArea / 20; request.setAttribute("newMatCost", newMatCost); request.setAttribute("newLaborCost", newLaborCost); request.setAttribute("newArea", newArea); request.setAttribute("newTotal", newTotal); request.setAttribute("totalTime", totalTime); return "fcresponse"; }