Spring MVC Concepts

From NovaOrdis Knowledge Base
Revision as of 03:55, 9 October 2018 by Ovidiu (talk | contribs) (→‎View)
Jump to navigation Jump to search

Internal

To Process

TO PROCESS:

Controller

@Controller

@GetMapping

View

View's logical name

Project Directory Layout

src/main/resource/static
src/main/resource/static/images

REST Clients

RestTemplate

TO PROCESS: https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#webmvc-resttemplate

POSTing Resource. Data

This overloaded version allows you to receive the newly created resource as a domain model object:

RestTemplate restTemplate = new RestTemplate();

MyResource model = new MyResource(...);

MyResource created = restTemplate.postForObject("http://localhost:8080/myresource", model, MyResource.class);