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:mx.com.quadrum.contratos.controller.service.user.UsuarioServiceController.java

@ResponseBody
@RequestMapping(value = "agregarPermisosToUser/{id}", method = RequestMethod.POST)
public String agregarPermisosUsuarios(@PathVariable("id") String id, HttpSession session) {
    if (session.getAttribute("usuario") == null) {
        return SESION_CADUCA;
    }/*from w  w w  .  j  ava  2 s .com*/
    return permisoUsuarioService.agregar(id);
}

From source file:de.document.controller.KrankheitController.java

@RequestMapping(value = "/save", method = { RequestMethod.POST })
public Document saveKrankheit(@RequestBody Krankheit request) {
    System.out.println("KrankheitController");

    System.out.println(request);/*  www  .j av  a 2 s .  c o m*/
    System.out.println("the list");

    // System.out.println(request.getUmls().getName());
    //System.out.println(request.getUebersicht().getText());
    //System.out.println(request.getUebersicht());

    return service.save(request);

}

From source file:fr.epsi.controllers.rest.LoginController.java

/**
 * Methode qui permet de connecter un utilisateur
 * @param username le username de l'utilisateur
 * @param password le password de l'utilisateur
 * @return Un message statut de la connexion
 *///from w  w  w .  jav  a 2 s  .  co m
@RequestMapping(value = "/connect", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody User connect(@RequestParam("username") String username,
        @RequestParam("password") String password, HttpServletResponse resp) {

    try {
        Users userModel = Users.getInstance();
        //On recuoere le user
        User user = userModel.findByUsername(username);

        // On retourne le guuid de l'utilisateur
        if (user.getPassword().equals(password)) {
            user.generateGUID();
            return user;
        }

        resp.setStatus(HttpServletResponse.SC_FORBIDDEN);
        return null;

    } catch (Exception e) {
        resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        return null;
    }
}

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

@RequestMapping(value = "create", method = RequestMethod.POST)
@ResponseBody//from ww  w  . j  a  va2 s  .c om
public String create(@RequestBody Attrib attrib) {
    attribService.persist(attrib);
    return "Attrib: " + attrib.getDescription() + " created...";
}

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

@RequestMapping(value = "create", method = RequestMethod.POST)
@ResponseBody//  w  ww. ja v a  2s .  c  om
public String create(@RequestBody JcRole jcRole) {
    jcRoleService.persist(jcRole);
    return "JcRole: " + jcRole.getDescription() + " created...";
}

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

@RequestMapping(value = "create", method = RequestMethod.POST)
@ResponseBody//from  w w  w  .jav  a  2s  .  c  o m
public String create(@RequestBody JcUser jcUser) {
    jcUserService.persist(jcUser);
    return "JcUser: " + jcUser.getUserName() + " created...";
}

From source file:com.mycompany.springmvcaccount.controller.UserFormController.java

@RequestMapping(value = "/resultForm", method = RequestMethod.POST)
public ModelAndView resultForm(User user) {
    ModelAndView mv = new ModelAndView();
    mv.addObject("user", user);
    mv.setViewName("userResult");
    return mv;//w  ww  . j a  v  a2 s  .c  om
}

From source file:com.xinferin.controller.ProductController.java

@RequestMapping(value = "/add", method = RequestMethod.POST, consumes = "application/json")
@ResponseStatus(HttpStatus.CREATED)//from   ww w. ja v  a2  s .  co m
public void addProduct(@RequestBody Product product) {
    daoProduct.add(product);
}

From source file:rest.JugadorRestController.java

@RequestMapping(value = "/", method = RequestMethod.POST)
public ResponseEntity<?> guardarJugador(@RequestBody Jugador j) {
    logicaJugador.registrarJugador(j);//from ww w .  ja  v  a  2s . c  o  m
    return new ResponseEntity<>(HttpStatus.CREATED);
}

From source file:com.arindra.project.accounting.controllers.PaymentController.java

@RequestMapping(method = RequestMethod.POST, value = "/add/{username}/{password}")
public boolean createPayment(@RequestBody Payment payment, @PathVariable("username") String username,
        @PathVariable("password") String password) {
    if (payment != null) {
        paymentRepo.save(payment);/*from  w w w. j a  va2  s.  com*/
        return true;
    }
    return false;
}