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

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

Introduction

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

Prototype

RequestMethod POST

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

Click Source Link

Usage

From source file:com.drugstore.pdp.controller.TestRestController.java

@RequestMapping(value = "/test3", method = RequestMethod.POST)
public String test3() {
    Session session = factory.openSession();

    return "OK";

}

From source file:AES.Controllers.LoginController.java

@RequestMapping(value = "/verify", method = RequestMethod.POST)
public String test(@RequestParam Map<String, String> requestParams, // used to get all parameters using a map
        Model model, // used to add attributes to next/redirected page 
        HttpSession session // used to get current session
) {/*from w  w  w.ja  v a  2s. c  o  m*/
    //ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
    //HttpSession session = attr.getRequest().getSession();
    session.setAttribute("test", requestParams.get("password"));
    model.addAttribute("test", requestParams.get("username"));
    return "home";
}

From source file:programacaovi.todo.ItemController.java

@RequestMapping(method = RequestMethod.POST)
public Item addItem(@RequestBody Item item) {
    item.setId(null);
    return repo.saveAndFlush(item);
}

From source file:reviewbot.controllers.BookController.java

/**
 * Creates a book object in the db, then returns that book with the ID set.
 * @param bookDTO/*from  ww  w .j  a v a 2  s. c o  m*/
 * @return saved book
 */
@RequestMapping(value = "/createBook", method = RequestMethod.POST)
public @ResponseBody BookDTO createBook(@RequestBody BookDTO bookDTO) {
    return _bookService.create(bookDTO);
}

From source file:com.abcd.employeemaven.controller.SendEmailController.java

@RequestMapping(method = RequestMethod.POST)
public String doSendEmail(HttpServletRequest request, HttpServletResponse response,
        @ModelAttribute("email") Email email) throws IOException {
    String RecieptentEmail = request.getParameter("email");
    String subject = request.getParameter("subject");
    String message = request.getParameter("message");

    //console// www . jav a 2s . c om
    System.out.println("To: " + RecieptentEmail);
    System.out.println("Subject: " + subject);
    System.out.println("Message: " + message);

    //simple email object
    //        SimpleMailMessage email=new SimpleMailMessage();

    email.setTo(RecieptentEmail);

    email.setHost("smtp.ntc.net.np");
    email.setFrom("abcdgroupproject@gmail.com");
    email.setSubject(subject);
    email.setMessageBody(message);

    email.sendMail();

    return "redirect:/";

}

From source file:com.opencnc.controllers.TipoCodigoController.java

@RequestMapping(method = RequestMethod.POST)
public void actualizar() {

}

From source file:com.mohit.program.controller.product.ProductController.java

@RequestMapping(method = RequestMethod.POST)
public String doPost(Product p) {
    try {//from  w w  w  .  j  a v a  2s . c om
        if (productDao.insert(p) > 0) {
            return "redirect:/displayproduct?success";
        }
    } catch (SQLException | ClassNotFoundException ex) {

    }
    return "redirect:/?error";
}

From source file:uta.ak.usttmp.common.web.controller.UsttmpRestController.java

@RequestMapping(value = "/interfaceResponser", method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE)
public abstract ResponseEntity<String> getMessage(@RequestBody String message) throws Exception;

From source file:com.tsg.sitemapwebappmvc.controller.FactorizorController.java

@RequestMapping(value = "/FactorizorController", method = RequestMethod.POST)
public String getFactorResults(HttpServletRequest request, Model model) {

    Factors factorize = new Factors(Integer.parseInt(request.getParameter("numberToFactor")));
    request.setAttribute("factors", factorize.getFactors());
    request.setAttribute("perfect", factorize.isPerfect());
    request.setAttribute("prime", factorize.isPrime());

    return "factresponse";
}

From source file:ip.ip.rest.controller.BookRestController.java

@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public void addBook(@RequestBody Book book) {
    service.addBook(book);
}