Merge branch 'master' into task/JAVA-26765

This commit is contained in:
Harry9656
2023-11-30 00:58:57 +01:00
committed by GitHub
244 changed files with 3134 additions and 379 deletions
+1
View File
@@ -44,6 +44,7 @@
<module>spring-rest-simple</module>
<module>spring-rest-testing</module>
<module>spring-resttemplate</module>
<module>spring-resttemplate-1</module>
<module>spring-resttemplate-2</module>
<module>spring-resttemplate-3</module>
<module>spring-session</module>
@@ -150,7 +150,7 @@
<properties>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<deploy-path>enter-location-of-server</deploy-path>
<org.thymeleaf-version>3.0.11.RELEASE</org.thymeleaf-version>
<org.thymeleaf-version>3.1.2.RELEASE</org.thymeleaf-version>
<groovy.version>2.4.12</groovy.version>
<freemarker.version>2.3.27-incubating</freemarker.version>
<jade.version>1.2.5</jade.version>
@@ -1,9 +1,7 @@
### Relevant Articles:
- [Cache Headers in Spring MVC](https://www.baeldung.com/spring-mvc-cache-headers)
- [Working with Date Parameters in Spring](https://www.baeldung.com/spring-date-parameters)
- [Spring MVC @PathVariable with a dot (.) gets truncated](https://www.baeldung.com/spring-mvc-pathvariable-dot)
- [A Quick Guide to Spring MVC Matrix Variables](https://www.baeldung.com/spring-mvc-matrix-variables)
- [Converting a Spring MultipartFile to a File](https://www.baeldung.com/spring-multipartfile-to-file)
- [Testing a Spring Multipart POST Request](https://www.baeldung.com/spring-multipart-post-request-test)
- [Spring @PathVariable Annotation](https://www.baeldung.com/spring-pathvariable)
@@ -14,3 +14,6 @@ The "REST With Spring" Classes: https://bit.ly/restwithspring
- [web.xml vs Initializer with Spring](https://www.baeldung.com/spring-xml-vs-java-config)
- [A Java Web Application Without a web.xml](https://www.baeldung.com/java-web-app-without-web-xml)
- [Accessing Spring MVC Model Objects in JavaScript](https://www.baeldung.com/spring-mvc-model-objects-js)
- [Spring @PathVariable Annotation](https://www.baeldung.com/spring-pathvariable)
- [Working with Date Parameters in Spring](https://www.baeldung.com/spring-date-parameters)
@@ -51,7 +51,7 @@
<properties>
<swagger2.version>2.9.2</swagger2.version>
<resilience4j.version>1.6.1</resilience4j.version>
<resilience4j.version>2.1.0</resilience4j.version>
<springdoc.version>1.7.0</springdoc.version>
</properties>
@@ -292,7 +292,7 @@
<cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version>
<findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version>
<!-- okhttp -->
<com.squareup.okhttp3.version>3.4.1</com.squareup.okhttp3.version>
<com.squareup.okhttp3.version>4.12.0</com.squareup.okhttp3.version>
<json.path.version>2.2.0</json.path.version>
</properties>
@@ -0,0 +1,7 @@
## Spring RestTemplate
This module contains articles about Spring RestTemplate
### Relevant Articles:
- [RestTemplate Post Request with JSON](https://www.baeldung.com/spring-resttemplate-post-json)
- [Get and Post Lists of Objects with RestTemplate](https://www.baeldung.com/spring-rest-template-list)
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-resttemplate-1</artifactId>
<version>0.1-SNAPSHOT</version>
<name>spring-resttemplate-1</name>
<packaging>war</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-2</relativePath>
</parent>
<dependencies>
<!-- Spring Boot Dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
</project>
@@ -1,16 +1,17 @@
package com.baeldung.resttemplate.lists.client;
import com.baeldung.resttemplate.lists.dto.Employee;
import com.baeldung.resttemplate.lists.dto.EmployeeList;
import static java.util.Arrays.asList;
import java.util.ArrayList;
import java.util.List;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
import static java.util.Arrays.asList;
import com.baeldung.resttemplate.lists.dto.Employee;
import com.baeldung.resttemplate.lists.dto.EmployeeList;
/**
* Application that shows how to use Lists with RestTemplate.
@@ -1,5 +1,7 @@
package com.baeldung.resttemplate.lists.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -10,8 +12,6 @@ import com.baeldung.resttemplate.lists.dto.Employee;
import com.baeldung.resttemplate.lists.dto.EmployeeList;
import com.baeldung.resttemplate.lists.service.EmployeeService;
import java.util.List;
@RestController
@RequestMapping("/employees")
public class EmployeeResource
@@ -1,12 +1,12 @@
package com.baeldung.resttemplate.lists.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Service;
import com.baeldung.resttemplate.lists.dto.Employee;
import java.util.ArrayList;
import java.util.List;
@Service("EmployeeListService")
public class EmployeeService
{
@@ -0,0 +1,2 @@
server.port=8080
server.servlet.context-path=/spring-rest
@@ -0,0 +1,5 @@
logging.level.org.springframework.web.client.RestTemplate=DEBUG
logging.level.com.baeldung.resttemplate.logging=DEBUG
logging.level.org.apache.http=DEBUG
logging.level.httpclient.wire=DEBUG
logging.pattern.console=%20logger{20} - %msg%n
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="15 seconds" debug="false">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%d{ISO8601}]-[%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
@@ -7,7 +7,6 @@ This module contains articles about Spring RestTemplate
- [Spring RestTemplate Request/Response Logging](https://www.baeldung.com/spring-resttemplate-logging)
- [Proxies With RestTemplate](https://www.baeldung.com/java-resttemplate-proxy)
- [A Custom Media Type for a Spring REST API](https://www.baeldung.com/spring-rest-custom-media-type)
- [RestTemplate Post Request with JSON](https://www.baeldung.com/spring-resttemplate-post-json)
- [How to Compress Requests Using the Spring RestTemplate](https://www.baeldung.com/spring-resttemplate-compressing-requests)
- [Get list of JSON objects with Spring RestTemplate](https://www.baeldung.com/spring-resttemplate-json-list)
- [Spring RestTemplate Exception: “Not enough variables available to expand”](https://www.baeldung.com/spring-not-enough-variables-available)
@@ -7,7 +7,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles:
- [Uploading MultipartFile with Spring RestTemplate](https://www.baeldung.com/spring-rest-template-multipart-upload)
- [Get and Post Lists of Objects with RestTemplate](https://www.baeldung.com/spring-rest-template-list)
- [Download a Large File Through a Spring RestTemplate](https://www.baeldung.com/spring-resttemplate-download-large-file)
- [Access HTTPS REST Service Using Spring RestTemplate](https://www.baeldung.com/spring-resttemplate-secure-https-service)
- [Encoding of URI Variables on RestTemplate](https://www.baeldung.com/spring-resttemplate-uri-variables-encode)

Some files were not shown because too many files have changed in this diff Show More