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.davidmogar.alsa.web.controllers.bus.BusController.java

@RequestMapping(value = "/admin/buses/save", method = RequestMethod.POST)
public String saveBuses(@Valid @ModelAttribute("bus") BusDto busDto, BindingResult bindingResult) {
    String view = "admin.buses.create";

    if (!bindingResult.hasErrors()) {
        busManagerService.save(busDto);//from  w  ww  .  java  2  s.  c  om

        view = "redirect:/admin/buses/list";
    }

    return view;
}

From source file:com.horas.web.CommentController.java

/**
 *
 * @param comment/*from   ww  w  .j  a v a 2s .  c o  m*/
 * @return
 */
@RequestMapping(value = "/addcomments", method = RequestMethod.POST)
@ResponseBody
public ResponseMessage addCommentNews(@RequestBody Comment comment, HttpServletRequest request) {
    String username;
    HttpSession sess = request.getSession();
    username = (String) sess.getAttribute("username");
    comment.setIdComment(sys_guid());
    //  comment.setIdNews(sys_guid());
    comment.setUserComment(username);
    comment.setIpComment("127.0.0.2");
    comment.setDateComment(new Date());
    commentService.addCommentNews(comment);
    return new ResponseMessage(ResponseMessage.Type.success, "commentAdded");
}

From source file:streaming.controller.HomePageController.java

@RequestMapping(value = "ajouter", method = RequestMethod.POST)
public String ajouterPost(@ModelAttribute(value = "monEffaceMoi") Effacemoi em) {
    //        em.setNom("nom");
    //        em.setPrenom("prenom");

    effacemoiCrudService.save(em);//from  ww w  .j  a  va2  s  . c  om
    return "redirect:/effacemoi/lister";

}

From source file:edu.lfa.webapp.controller.AccountController.java

@RequestMapping(value = "/save", method = RequestMethod.POST)
public String save(AccountDTO accDTO) {
    Account account = new Account();
    account.setAccountName(accDTO.getName());
    account.setInterest(accDTO.getInterest());
    account.setMinimumBalance(accDTO.getBalance());
    account.setStatus(accDTO.isStatus());

    accountDAO.insert(account);/* w w  w .j av  a  2  s  . c o m*/
    return "redirect:/admin/account/all";
}

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

@RequestMapping(value = "/bank", method = RequestMethod.POST)
public void saveBank(@RequestBody Bank bank) throws Exception {
    if (bank == null) {
        throw new Exception("Tidak boleh kosong");
    }/*from   w  ww  .j  av  a 2 s.co  m*/

    bankService.save(bank);
}

From source file:school.controller.Controller.java

@RequestMapping(method = RequestMethod.POST, consumes = "application/json")
public T create(@RequestBody T entity, final HttpServletResponse response) {
    setHeaders(response);/*  w  w  w . j  a  v a2s  . c o  m*/
    return create(entity);
}

From source file:com.suntek.gztpb.controller.ChangeCarControll.java

@RequestMapping(value = "saveCarInfo.htm", method = RequestMethod.POST)
public @ResponseBody String saveTest(CarChangeModel carInfo, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    response.setContentType("text/html");
    response.setCharacterEncoding("utf-8");
    PrintWriter out = response.getWriter();

    String applyNum = IdGenerator.getInstance().getBizCode("ITMS_SEQ", 5);
    carInfo.setApplynum(applyNum);/*from   w w w .ja  va  2  s.co m*/

    carInfo.setCreatedtime(new Date());
    carInfo.setFirstregdate(new Date());
    carInfo.setFinish(0);
    carInfo.setSource(0);
    carInfo.setSubmittime(new Date());

    carInfo.setCreator(request.getParameter("ownername"));

    try {
        carChangeService.signUp(carInfo);
        out.write("<script>parent.saveCallback(1,'" + applyNum + "')</script>");
    } catch (Exception e) {
        e.printStackTrace();
        out.write("<script>parent.saveCallback(0)</script>");
    }
    return null;
}

From source file:com.mycompany.loginApp.controller.UserController.java

@RequestMapping(value = "/registerUser", method = RequestMethod.POST)
public String saveUser(@ModelAttribute("user") User user) {
    userService.saveUser(user);/*from   ww w.  jav a2  s. c  om*/
    return "redirect:registerUser?success=true";
}

From source file:controllers.EventCntrl.java

@RequestMapping(value = "/organize", method = RequestMethod.POST)
public String organizeEvent(@ModelAttribute("event") Event event, Model mo) { // what about info related to organizer?

    return "events"; // specify view.
}

From source file:any.shop.web.controller.BuyerController.java

@RequestMapping(method = RequestMethod.POST)
public Buyer save(@RequestBody Buyer buyer) {
    return buyerService.save(buyer);
}