Spring MVC Concepts: Difference between revisions
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
<font color=darkgray> TO PROCESS: https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#webmvc-resttemplate</font> | <font color=darkgray> TO PROCESS: https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#webmvc-resttemplate</font> | ||
===POSTing Resource. Data=== | |||
This overloaded version allows you to receive the newly created resource as a domain model object: | |||
<syntaxhighlight lang='java'> | |||
RestTemplate restTemplate = new RestTemplate(); | |||
MyResource model = new MyResource(...); | |||
MyResource created = restTemplate.postForObject("http://localhost:8080/myresource", model, MyResource.class); | |||
</syntaxhighlight> |
Revision as of 20:13, 8 October 2018
Internal
To Process
TO PROCESS:
- https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/web.html#spring-web
- https://spring.io/guides/gs/rest-service/
- https://spring.io/guides/gs/serving-web-content/
- https://spring.io/guides/tutorials/bookmarks/
- https://docs.spring.io/spring-boot/docs/2.0.5.RELEASE/reference/htmlsingle/#boot-features-developing-web-applications
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);