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:controllers.serviciosController.java

@RequestMapping(value = "/serviciosCRUD_registrar.htm", method = RequestMethod.POST)
public String registrar(@RequestParam("nombre") String nombre, @RequestParam("descripcion") String descripcion,
        @RequestParam("costo") int costo, Model model) {
    ServiciosDAO servicioDAO = new ServiciosDAO();
    servicioDAO.ingresarServicio(nombre, descripcion, costo);
    model.addAttribute("servicios", servicioDAO.obtenerServicios());
    return "servicios";
}

From source file:org.unitec.maven.ControladorTarjeta.java

@RequestMapping(value = "/tarjeta/{nombre}/{fechaCorte}", method = RequestMethod.POST, headers = {
        "Accept=text/html" })

@ResponseBody//from w  w  w . j  a v  a2 s  .com
String guardarTarjeta(@PathVariable String nombre, @PathVariable Integer fechaCorte) throws Exception {
    Tarjeta t = new Tarjeta();
    t.setDiacorte(fechaCorte);
    t.setNombre(nombre);
    DAOTarjeta dao = new DAOTarjeta();
    dao.guardar(t);
    return "Tarjeta Guardada";

}

From source file:com.project.framework.controller.FooterController.java

@RequestMapping(value = "/footer", method = { RequestMethod.GET, RequestMethod.POST })
public String setFooter(ModelMap model) {
    model.addAttribute("continentes", continenteService.getContinentesConIdioma());
    return "framework/footer";
}

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

@RequestMapping(value = "/register", method = RequestMethod.POST, consumes = "application/json")
@ResponseStatus(HttpStatus.CREATED)/*from  w  w  w .  j  a  va 2 s  .  c o m*/
public void register(@RequestBody CustomerRegistration customerRegistration) throws Exception {
    daoCustomerRegistration.register(customerRegistration);
}

From source file:com.onclave.testbench.TESTBENCH.TestbenchController.java

@RequestMapping(value = "/testbench/jsFormSubmitTest", method = RequestMethod.POST)
public String jsFormSubmitView(HttpServletRequest request) {
    System.out.println("==========================================================");
    System.out.println("==========================================================");
    System.out.println("==========================================================");
    System.out.println("In method");
    System.out.println("data : " + request.getParameter("testInput"));
    System.out.println("DATA : " + request.getParameter("_csrf"));
    System.out.println("==========================================================");
    System.out.println("==========================================================");
    System.out.println("==========================================================");
    return "/testbench/JSFormSubmit/jsFormSubmitTest";
}

From source file:se.likfarmenhet.garage.controller.VehicleController.java

@RequestMapping(value = "/create", method = RequestMethod.POST)
public Vehicle createVehicle(@RequestBody Vehicle vehicle) {
    String lp = vehicle.getLicensePlate();
    try {//from ww  w  .j av a2 s .  c om
        if (lp.equalsIgnoreCase(findByLicensePlate(lp).getLicensePlate())) {
            updateVehicle(vehicle);
        }
    } catch (NullPointerException e) {
        vehicle = vehicleRepository.save(vehicle);
    }
    return vehicle;
}

From source file:com.javaps.springboot.LicenseController.java

@RequestMapping(value = "/public/license", produces = "text/plain", method = RequestMethod.POST)
public String licenseValidate(HttpServletRequest req, @RequestBody String license) throws Exception {
    String clientIp = req.getHeader("X-Forwarded-For"); //nginx???IP
    if (clientIp == null)
        clientIp = req.getRemoteAddr(); //?????
    //System.out.println("clientIp="+clientIp);
    SecretKeySpec signingKey = new SecretKeySpec(licenseSecretKey.getBytes(), "HmacSHA1");
    Mac mac = Mac.getInstance("HmacSHA1");
    mac.init(signingKey);// w  ww.j  a va  2 s .c o m

    byte[] rawHmac = mac.doFinal(clientIp.getBytes());
    //System.out.println("license should be:"+Base64.encodeBase64String(rawHmac));
    if (!license.equals(Base64.encodeBase64String(rawHmac)))
        throw new Exception();

    return "OK";
}

From source file:com.poscoict.license.web.controller.CertificateController.java

@RequestMapping(value = { "certificateDownloadInfo" }, method = { RequestMethod.POST })
public ModelAndView getLicenseCertification(HttpSession session, String licenseFileName, HttpServletRequest req)
        throws Exception {
    System.out.println("~~~~~~~~~~~~~~~~~~licenseFileName: " + licenseFileName);
    ModelAndView mv = new ModelAndView();
    mv.setViewName("certificateDownload/certificateView");

    Map<String, Object> map = (Map<String, Object>) certificateService
            .getLicenseCertification((String) session.getAttribute("USER_NO"), licenseFileName, req);
    mv.addObject("ImgFileName", map.get("ImgFileName"));
    mv.addObject("PDFFileName", map.get("PDFFileName"));

    return mv;//from w w  w  .  j a va 2 s  .  c  om
}

From source file:com.synjones.web.ui.user.feign.UserFeignClient.java

@RequestMapping(value = "/user", method = RequestMethod.POST)
public User getByParam(@RequestBody User user);

From source file:com.surfs.storage.web.controller.storage.LogoutController.java

@RequestMapping(method = RequestMethod.POST, value = "/monitor/logout.do")
public ModelAndView logoutMonitor(HttpServletRequest request) {
    return logout(request);
}