Skip to Content
Full Stack Development with JHipster
book

Full Stack Development with JHipster

by Deepu K Sasidharan, Sendil Kumar N
March 2018
Intermediate to advanced content levelIntermediate to advanced
380 pages
9h 23m
English
Packt Publishing
Content preview from Full Stack Development with JHipster

Resource class for the entity

 In the src/main/java/com/mycompany/store/web/rest folder you will find the entity resource service. Open ProductResource.java:

@RestController@RequestMapping("/api")public class ProductResource {   ...}

The resource acts as the controller layer and in our case, it serves the REST endpoints to be used by our client-side code. The endpoint has a base mapping to "/api":

    @GetMapping("/products")    @Timed    public ResponseEntity<List<Product>> getAllProducts(Pageable     pageable) {        log.debug("REST request to get a page of Products");        Page<Product> page = productService.findAll(pageable);        HttpHeaders headers =         PaginationUtil.generatePaginationHttpHeaders(page,         "/api/products"); return new ResponseEntity<>(page.getContent(), ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full Stack Development with JHipster - Second Edition

Full Stack Development with JHipster - Second Edition

Deepu K Sasidharan, Sendil Kumar Nellaiyapen
Jasmine Cookbook

Jasmine Cookbook

Munish Kumar

Publisher Resources

ISBN: 9781788476317Supplemental Content