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.swcguild.group3capstone.controller.AdminController.java

@RequestMapping(value = "/addBlog", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)//from   ww  w.  java2  s. c o m
@ResponseBody
public String addBlog(Blog blog) { // go to tinyMCE editor
    blogDAO.addBlog(blog);
    return "redirect:AddBlog";
}

From source file:org.terasoluna.gfw.functionaltest.app.transactiontoken.customstoresize.TransactionTokenCustomFlow3Controller.java

@RequestMapping(value = "createFlow_2", method = RequestMethod.POST)
@TransactionTokenCheck(value = "create", type = TransactionTokenType.BEGIN)
public String customflowStepBegin() {
    return "transactiontoken/customStoreSizeNext";
}

From source file:com.github.hateoas.forms.spring.uber.UberActionTest.java

@Test
public void translatesPostToAppend() throws Exception {
    assertEquals(UberAction.APPEND, UberAction.forRequestMethod(RequestMethod.POST));
}

From source file:org.terasoluna.gfw.functionaltest.app.transactiontoken.TransactionTokenCreateController2.java

@RequestMapping(value = "1_3", method = RequestMethod.POST)
@TransactionTokenCheck(value = "create", type = TransactionTokenType.BEGIN)
public String functionTest1_3_Create() {
    return "transactiontoken/createOutput";
}

From source file:th.co.geniustree.intenship.advisor.controller.TeacherController.java

@RequestMapping(value = "/saveteacher", method = RequestMethod.POST)
public void saveTeacher(@Validated @RequestBody Teacher teacher) {
    teacherRepo.save(teacher);
}

From source file:com.mohit.program.controller.customer.CustomerController.java

@RequestMapping(method = RequestMethod.POST)
public String doPost(Customer c) {
    try {//from   ww w .j  av a2s  . c om
        if (customerDao.insert(c) > 0) {
            return "redirect:/?success";
        }
    } catch (ClassNotFoundException | SQLException ex) {

    }
    return "redirect:/?error";
}

From source file:com.mohit.program.controller.customer.SupplierController.java

@RequestMapping(method = RequestMethod.POST)
public String doPost(Supplier s) {
    try {/*from   w  ww . j av  a  2 s  .c o  m*/
        if (supplierDao.insert(s) > 0) {
            return "redirect:/?success";
        }
    } catch (SQLException | ClassNotFoundException ex) {

    }
    return "redirect:/?error";
}

From source file:com.neu.controller.APIController.java

@RequestMapping(value = "/apicall.htm", method = RequestMethod.POST, headers = "Accept=*/*", produces = "application/json")
@ResponseStatus(HttpStatus.OK)//from   ww  w.  jav a 2 s.  co  m
public @ResponseBody String searchresult(HttpServletRequest request) throws Exception {
    Map pmap = request.getParameterMap();
    System.out.println("in drugsearch controller");
    String action = request.getParameter("action");
    String urlRestWebService = "https://ussouthcentral.services.azureml.net/workspaces/168eb4a3d72e4b078160213fcdaa4333/services/ee080088b48141e0af10c9913067689d/execute?api-version=2.0&details=true";
    HttpHeaders headers = new HttpHeaders();
    headers.add("Authorization",
            "Bearer AJacooh+WG4WeJTntLNn/E3A3E4yQELYY8S6/2sbpcsBvNFSCabuopvuiqlnrd47a0qBf4Coj1LMcEhBUm0Ujw==");
    headers.add("Content-Length", "100000");
    headers.add("Content-Type", "application/json");

    String requestJson = "{'Inputs': {'input1': {'ColumnNames': [ 'drugname','route','dose_amt','dose_unit','dose_form', 'dose_freq','mfr_sndr','pt'],'Values':[['"
            + pmap.get("drugname") + "','" + pmap.get("reactionlist") + "','" + pmap.get("doseform") + "','"
            + pmap.get("doseunit") + "','" + pmap.get("dosefreq") + "','" + pmap.get("mfndetails") + "','"
            + pmap.get("route") + "','" + pmap.get("doseamt") + "']]}},'GlobalParameters': {}}";

    HttpEntity<String> entity = new HttpEntity<String>(requestJson, headers);
    System.out.println("entity" + entity);
    RestTemplate restTemplate = new RestTemplate();

    String restData = restTemplate.postForObject(urlRestWebService, entity, String.class);

    ObjectMapper mapper = new ObjectMapper();
    mapper.enable(SerializationConfig.Feature.INDENT_OUTPUT);
    mapper.writeValue(System.out, restData);

    //            Drugs drug=new Drugs("AZ","sn");
    return mapper.writeValueAsString(restData);
}

From source file:com.surfs.storage.web.controller.block.PoolController.java

@RequestMapping(method = RequestMethod.POST, value = "/deleteRemoteVol.do")
@ResponseBody/*w w  w . j ava  2  s .c  o m*/
public String deleteRemoteVol(@RequestBody Map<String, String> args) {
    return poolService.deleteRemoteVol(args);
}

From source file:com.swcguild.addressbookarch.controller.ByCity.java

@RequestMapping(value = "bycity/address", method = RequestMethod.POST)
@ResponseBody//from  w  w w  .  j  a va  2 s .co m
public List<Address> searchInCity(@RequestBody Map<String, String> searchMap) {
    // Create the map of search criteria to send to the DAO
    Map<SearchTerm, String> criteriaMap = new HashMap<>();
    // Determine which search terms have values, translate the String
    // keys into SearchTerm enums, and set the corresponding values
    // appropriately.
    String currentTerm = searchMap.get("city");
    if (!currentTerm.isEmpty()) {
        criteriaMap.put(SearchTerm.CITY, currentTerm);
    }

    return dao.searchByCity(criteriaMap);
}