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:th.co.geniustree.dental.controller.TypeOfMedicalController.java

@RequestMapping(value = "/savetypeofmedical", method = RequestMethod.POST)
private void saveTypeOfMedical(@RequestBody TypeOfMedical typeOfMedical) {
    typeOfMedicalRepo.save(typeOfMedical);
}

From source file:com.mycompany.gis2.resource.AdministratorzyResource.java

@RequestMapping(value = "/admin", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity isCorrect(@RequestBody Administratorzy admin) {
    Administratorzy adminRep = adminRepository.findOneByLogin(admin.getLogin());

    return (admin.getHaslo().equals(adminRep.getHaslo())) ? new ResponseEntity(HttpStatus.OK)
            : new ResponseEntity(HttpStatus.UNAUTHORIZED);
}

From source file:tp.project.trafficviolationsystem.presentation.rest.DriverRestController.java

@RequestMapping(value = "create", method = RequestMethod.POST)
@ResponseBody//from w  ww.  j a  va 2 s .  com
public String createDriver(@RequestBody Driver driver) {
    driverRepository.save(driver);
    return "Driver Created";
}

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

@RequestMapping(value = "create", method = RequestMethod.POST)
@ResponseBody//from   w  w w  .j ava2  s .  co m
public String create(@RequestBody Site site) {
    siteService.persist(site);
    return "Site: " + site.getName() + " created...";
}

From source file:com.ync365.px.web.account.LoginController.java

@RequestMapping(method = RequestMethod.POST)
public String fail(HttpServletRequest request, HttpServletResponse response) {
    String msg = (String) request.getAttribute("shiroLoginFailure");
    if (StringUtils.length(msg) >= 15) {//?????
        request.setAttribute("errorMsg", "???");
    } else {/*from   w w w  .j  ava 2  s  . co  m*/
        request.setAttribute("errorMsg", msg);
    }
    if (!SecurityUtils.getSubject().isAuthenticated()) {
        response.setStatus(901);
        return "account/login_soft";
    }
    return "redirect:/tohomepage";
}

From source file:com.base.controller.CourseController.java

@RequestMapping(value = "/admin/course", method = RequestMethod.POST)
public String addNewStudent(@ModelAttribute("course") Course crs, ModelMap map) {
    System.out.println(crs.getCName());
    try {/* www.  j  a v a 2s . com*/
        CourseDAO.addCourse(crs);
        map.addAttribute("save_info", "Course added succesfully!");
        map.addAttribute("courses", CourseDAO.getCourses());

    } catch (Exception e) {
        map.addAttribute("save_info", "Database error!");
        e.printStackTrace();
    }

    return "course";
}

From source file:lydichris.smashbracket.controllers.UserController.java

@RequestMapping(value = "/users", method = RequestMethod.POST)
User createUser(@RequestParam String username, @RequestParam String password, @RequestParam String email) {
    return userService.maybeCreateUser(username, password, email);
}

From source file:com.kata.anagram.controllers.AnagramController.java

@RequestMapping(value = "/anagrams", method = RequestMethod.POST)
public String anagramSubmit(@ModelAttribute AnagramModel anagram, Model model) {
    String baseCase = anagram.getWord();
    int combinations = anagram.getCombination();
    anagram.setAnagrams(anagramHelper.findAnagrams(baseCase, combinations));
    model.addAttribute("anagram", anagram);

    return "anagrams";
}

From source file:pl.altkom.spring.capgemini.web.controller.CustomerController.java

@RequestMapping(value = "/save", method = RequestMethod.POST)
public String saveCustomer(@Valid Customer customer, BindingResult result) {

    logger.debug(customer);//from  w  w w .  j  av  a  2 s.c o m

    if (result.hasErrors()) {
        logger.warn("bd walidacji");
        return "customer/edit-customer";
    }

    return "redirect:/home";
}

From source file:com.dub.skoolie.web.controller.system.schedule.events.SystemUserEventController.java

@RequestMapping(value = "/system/schedule/events/user", method = RequestMethod.POST)
public ModelAndView addUserEvent(@Valid UserEventBean userEventBean, BindingResult result, Model model,
        HttpServletRequest request) {/*  w w  w .  ja  va2  s  . c  om*/
    String referrer = request.getHeader("Referer");
    if (result.hasErrors()) {
        if (!referrer.equals("/system/schedule/events/user")) {
            return new ModelAndView("redirect:" + referrer);
        }
        return new ModelAndView("system/schedule/events/index");
    }
    uiUserEventServiceImpl.addUserEvent(userEventBean);
    return new ModelAndView("system/schedule/events/index");
}