Example usage for org.springframework.http HttpStatus NO_CONTENT

List of usage examples for org.springframework.http HttpStatus NO_CONTENT

Introduction

In this page you can find the example usage for org.springframework.http HttpStatus NO_CONTENT.

Prototype

HttpStatus NO_CONTENT

To view the source code for org.springframework.http HttpStatus NO_CONTENT.

Click Source Link

Document

204 No Content .

Usage

From source file:com.arya.latihan.controller.SalesOrderController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@Transactional(readOnly = false)/*w  ww  .j ava 2s . c  om*/
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteSalesOrder(@PathVariable("/{id}") String id) {
    salesOrderRepository.delete(id);
}

From source file:com.consol.citrus.demo.javaland.EmployeeResourceTest.java

@Test
@InSequence(1)/*from  w ww.j  av  a 2 s .c om*/
@CitrusTest
public void testPostAndGet(@CitrusResource TestDesigner citrus) {
    citrus.http().client(serviceUri).post().contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .payload("name=Penny&age=20");

    citrus.http().client(serviceUri).response(HttpStatus.NO_CONTENT);

    citrus.http().client(serviceUri).post().contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .payload("name=Leonard&age=21");

    citrus.http().client(serviceUri).response(HttpStatus.NO_CONTENT);

    citrus.http().client(serviceUri).post().contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .payload("name=Sheldon&age=22");

    citrus.http().client(serviceUri).response(HttpStatus.NO_CONTENT);

    citrus.http().client(serviceUri).get().accept(MediaType.APPLICATION_XML);

    citrus.http().client(serviceUri).response(HttpStatus.OK)
            .payload("<employees>" + "<employee>" + "<age>20</age>" + "<name>Penny</name>" + "</employee>"
                    + "<employee>" + "<age>21</age>" + "<name>Leonard</name>" + "</employee>" + "<employee>"
                    + "<age>22</age>" + "<name>Sheldon</name>" + "</employee>" + "</employees>");

    citrusFramework.run(citrus.getTestCase());
}

From source file:com.tsg.cms.CategoryController.java

@RequestMapping(value = "/category/{id}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ResponseBody//w ww  . j a  va  2  s.  c  o  m
public CategoryContainer updateCategory(@PathVariable("id") int id, @Valid @RequestBody Category category) {

    category.setCategoryId(id);
    CategoryContainer categoryContainer = new CategoryContainer();

    categoryContainer.setCategory(dao.updateCategory(category));

    return categoryContainer;
}

From source file:com.arya.latihan.controller.CustomerController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@Transactional(readOnly = false)/*w ww .j a v  a2  s .  c  o m*/
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteCustomer(@PathVariable("id") String id) {
    customerRepository.delete(id);
}

From source file:org.zols.datastore.web.controller.PageController.java

@RequestMapping(value = "/api/pages/{name}", method = DELETE)
@ApiIgnore/*  w ww .  ja v  a 2s  .  c  om*/
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void delete(@PathVariable(value = "name") String name) {
    LOGGER.info("Deleting page with id {}", name);
    pageManager.deletePage(name);
}

From source file:com.tsg.cms.StaticPageController.java

@RequestMapping(value = "/staticPage/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteStaticPage(@PathVariable("id") int id) {
    staticPageDao.removeStaticPage(id);//  w  w w  . ja va2 s  .c o  m
}

From source file:nl.surfnet.mujina.controllers.CommonAPI.java

@RequestMapping(value = { "/signing-credential" }, method = RequestMethod.POST)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ResponseBody/*ww w.  j a  v  a2 s .co m*/
public void setSigningCredential(@RequestBody Credential credential) {
    log.debug("Request to set signing credential");
    configuration.injectCredential(credential.getCertificate(), credential.getKey());
}

From source file:com.tsguild.upsproject.controller.HomeController.java

@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value = "/plane/planeId", method = RequestMethod.PUT)
public void updatePlane(@PathVariable("planeId") String planeId, @RequestBody Plane updatedPlane) {
    updatedPlane.setId(planeId);//from w w  w .  j  a v a2s  . c om
    dao.updatePlane(updatedPlane);
}

From source file:org.zols.datastore.web.SchemaControler.java

@RequestMapping(value = "/{id}", method = DELETE)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void delete(@PathVariable(value = "id") String id) throws DataStoreException {
    LOGGER.info("Deleting jsonSchemas with id {}", id);
    schemaService.delete(id);//from w ww.j  ava 2s  .c o m
}

From source file:com.consol.citrus.samples.javaee.employee.EmployeeResourceTest.java

@Test
@InSequence(1)//from w w  w  .  j  ava 2  s. co  m
@CitrusTest
public void testPostAndGet(@CitrusResource TestDesigner citrus) {
    citrus.http().client(serviceUri).send().post().contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .payload("name=Penny&age=20");

    citrus.http().client(serviceUri).receive().response(HttpStatus.NO_CONTENT);

    citrus.http().client(serviceUri).send().post().contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .payload("name=Leonard&age=21");

    citrus.http().client(serviceUri).receive().response(HttpStatus.NO_CONTENT);

    citrus.http().client(serviceUri).send().post().contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .payload("name=Sheldon&age=22");

    citrus.http().client(serviceUri).receive().response(HttpStatus.NO_CONTENT);

    citrus.http().client(serviceUri).send().get().accept(MediaType.APPLICATION_XML);

    citrus.http().client(serviceUri).receive().response(HttpStatus.OK)
            .payload("<employees>" + "<employee>" + "<age>20</age>" + "<name>Penny</name>" + "</employee>"
                    + "<employee>" + "<age>21</age>" + "<name>Leonard</name>" + "</employee>" + "<employee>"
                    + "<age>22</age>" + "<name>Sheldon</name>" + "</employee>" + "</employees>");

    citrusFramework.run(citrus.getTestCase());
}