repo
stringclasses
1k values
file_url
stringlengths
96
373
file_path
stringlengths
11
294
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
6 values
commit_sha
stringclasses
1k values
retrieved_at
stringdate
2026-01-04 14:45:56
2026-01-04 18:30:23
truncated
bool
2 classes
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/lists/client/EmployeeClient.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/lists/client/EmployeeClient.java
package com.baeldung.resttemplate.lists.client; 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....
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/logging/web/controller/PersonController.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/logging/web/controller/PersonController.java
package com.baeldung.resttemplate.logging.web.controller; import java.util.Arrays; import java.util.List; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class PersonController { @PostMapping("/persons") public...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/restcallscompletablefuture/Purchase.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/restcallscompletablefuture/Purchase.java
package com.baeldung.resttemplate.restcallscompletablefuture; public class Purchase { private String orderDescription; private String paymentDescription; private String buyerName; private final String orderId; private final String paymentId; private final String userId; public Purchase(St...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/restcallscompletablefuture/PurchaseRestCallsAsyncExecutor.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/restcallscompletablefuture/PurchaseRestCallsAsyncExecutor.java
package com.baeldung.resttemplate.restcallscompletablefuture; import static java.lang.String.format; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.function.BiFunction; import org.springframework.http.ResponseEntity; import org.springframe...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/controller/PersonAPI.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/controller/PersonAPI.java
package com.baeldung.resttemplate.web.controller; import jakarta.servlet.http.HttpServletResponse; import com.baeldung.resttemplate.web.service.PersonService; import com.baeldung.resttemplate.web.dto.Person; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation....
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/controller/redirect/RedirectController.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/controller/redirect/RedirectController.java
package com.baeldung.resttemplate.web.controller.redirect; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/controller/redirect/RedirectParamController.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/controller/redirect/RedirectParamController.java
package com.baeldung.resttemplate.web.controller.redirect; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.spr...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/https/WelcomeController.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/https/WelcomeController.java
package com.baeldung.resttemplate.web.https; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class WelcomeController { @GetMapping(value = "/welcome") public String welcome() { return "Welcome To Secured R...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/https/HttpsEnabledApplication.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/https/HttpsEnabledApplication.java
package com.baeldung.resttemplate.web.https; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; @ComponentScan(basePackages = ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/dto/Person.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/dto/Person.java
package com.baeldung.resttemplate.web.dto; public class Person { private Integer id; private String name; public Person() { } public Person(Integer id, String name) { this.id = id; this.name = name; } public Integer getId() { return id; } public void set...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/service/PersonService.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/service/PersonService.java
package com.baeldung.resttemplate.web.service; import com.baeldung.resttemplate.web.dto.Person; public interface PersonService { public Person saveUpdatePerson(Person person); public Person findPersonById(Integer id); }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/service/PersonServiceImpl.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/service/PersonServiceImpl.java
package com.baeldung.resttemplate.web.service; import com.baeldung.resttemplate.web.dto.Person; import org.springframework.stereotype.Component; @Component public class PersonServiceImpl implements PersonService { @Override public Person saveUpdatePerson(Person person) { return person; } @Ov...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/upload/controller/FileServerResource.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/upload/controller/FileServerResource.java
package com.baeldung.resttemplate.web.upload.controller; import java.io.IOException; import java.util.List; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestM...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/upload/app/UploadApplication.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/upload/app/UploadApplication.java
package com.baeldung.resttemplate.web.upload.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.support.SpringBootServletInitializ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/upload/client/MultipartFileUploadClient.java
spring-web-modules/spring-resttemplate-1/src/main/java/com/baeldung/resttemplate/web/upload/client/MultipartFileUploadClient.java
package com.baeldung.resttemplate.web.upload.client; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHe...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-java-3/src/test/java/com/baeldung/accessparamsjs/ControllerUnitTest.java
spring-web-modules/spring-mvc-java-3/src/test/java/com/baeldung/accessparamsjs/ControllerUnitTest.java
package com.baeldung.accessparamsjs; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.spring...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-java-3/src/test/java/com/baeldung/filters/HttpRequestUnitTest.java
spring-web-modules/spring-mvc-java-3/src/test/java/com/baeldung/filters/HttpRequestUnitTest.java
package com.baeldung.filters; import jakarta.servlet.Filter; import jakarta.servlet.ServletException; import jakarta.servlet.ServletInputStream; import jakarta.servlet.ServletRequest; import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockFilterChain;...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-java-3/src/main/java/com/baeldung/accessparamsjs/Controller.java
spring-web-modules/spring-mvc-java-3/src/main/java/com/baeldung/accessparamsjs/Controller.java
package com.baeldung.accessparamsjs; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import java.util.Map; /** * Sample rest controller for the tutorial article * "Access Spring MVC M...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-java-3/src/main/java/com/baeldung/accessparamsjs/App.java
spring-web-modules/spring-mvc-java-3/src/main/java/com/baeldung/accessparamsjs/App.java
package com.baeldung.accessparamsjs; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class App { public static void main(String[] args) { SpringApplication.run(App.class, args); } }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-java-3/src/main/java/com/baeldung/filters/CacheRequestContentFilter.java
spring-web-modules/spring-mvc-java-3/src/main/java/com/baeldung/filters/CacheRequestContentFilter.java
package com.baeldung.filters; import org.springframework.web.util.ContentCachingRequestWrapper; import jakarta.servlet.*; import jakarta.servlet.annotation.WebFilter; import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; @WebFilter(urlPatterns = "/*") public class CacheRequestContentFilter impl...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/DataContentControllerIntegrationTest.java
spring-web-modules/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/DataContentControllerIntegrationTest.java
package com.baeldung.mvc.velocity.test; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasProperty; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.springframework.test.web.servlet.reques...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/config/TestConfig.java
spring-web-modules/spring-mvc-velocity/src/test/java/com/baeldung/mvc/velocity/test/config/TestConfig.java
package com.baeldung.mvc.velocity.test.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.view.velocity.VelocityConfigurer; import org.springframework.web.se...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/test/java/org/baeldung/SpringContextTest.java
spring-web-modules/spring-mvc-velocity/src/test/java/org/baeldung/SpringContextTest.java
package com.baeldung; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import com.baeldung.mvc.velocity.spring.c...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/controller/MainController.java
spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/controller/MainController.java
package com.baeldung.mvc.velocity.controller; import com.baeldung.mvc.velocity.domain.Tutorial; import com.baeldung.mvc.velocity.service.ITutorialsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.sp...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/service/TutorialsService.java
spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/service/TutorialsService.java
package com.baeldung.mvc.velocity.service; import com.baeldung.mvc.velocity.domain.Tutorial; import org.springframework.stereotype.Service; import java.util.Arrays; import java.util.List; @Service public class TutorialsService implements ITutorialsService { public List<Tutorial> listTutorials() { return...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/service/ITutorialsService.java
spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/service/ITutorialsService.java
package com.baeldung.mvc.velocity.service; import com.baeldung.mvc.velocity.domain.Tutorial; import java.util.List; public interface ITutorialsService { List<Tutorial> listTutorials(); }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/domain/Tutorial.java
spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/domain/Tutorial.java
package com.baeldung.mvc.velocity.domain; public class Tutorial { private final Integer tutId; private final String title; private final String description; private final String author; public Tutorial(Integer tutId, String title, String description, String author) { this.tutId = tutId; ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/spring/config/WebConfig.java
spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/spring/config/WebConfig.java
package com.baeldung.mvc.velocity.spring.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.conf...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/spring/config/MainWebAppInitializer.java
spring-web-modules/spring-mvc-velocity/src/main/java/com/baeldung/mvc/velocity/spring/config/MainWebAppInitializer.java
package com.baeldung.mvc.velocity.spring.config; import org.springframework.web.WebApplicationInitializer; import org.springframework.web.context.ContextLoaderListener; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.context.support.GenericWebApplica...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/test/java/com/baeldung/hateoasvsswagger/HateoasControllerIntegrationTest.java
spring-web-modules/spring-boot-rest-2/src/test/java/com/baeldung/hateoasvsswagger/HateoasControllerIntegrationTest.java
package com.baeldung.hateoasvsswagger; import com.baeldung.hateoasvsswagger.model.NewUser; import com.baeldung.hateoasvsswagger.model.User; import com.baeldung.hateoasvsswagger.repository.UserRepository; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.sprin...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/UserHateoasController.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/UserHateoasController.java
package com.baeldung.hateoasvsswagger; import com.baeldung.hateoasvsswagger.model.NewUser; import com.baeldung.hateoasvsswagger.model.User; import com.baeldung.hateoasvsswagger.repository.UserRepository; import org.springframework.hateoas.CollectionModel; import org.springframework.hateoas.EntityModel; import org.spr...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/UserController.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/UserController.java
package com.baeldung.hateoasvsswagger; import com.baeldung.hateoasvsswagger.model.NewUser; import com.baeldung.hateoasvsswagger.model.User; import com.baeldung.hateoasvsswagger.repository.UserRepository; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swag...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/SpringBootRestApplication.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/SpringBootRestApplication.java
package com.baeldung.hateoasvsswagger; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringBootRestApplication { public static void main(String[] args) { SpringApplication.run(SpringBootRestAppli...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/model/NewUser.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/model/NewUser.java
package com.baeldung.hateoasvsswagger.model; public record NewUser(String name, String email) { }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/model/User.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/model/User.java
package com.baeldung.hateoasvsswagger.model; import org.springframework.hateoas.RepresentationModel; import java.time.LocalDateTime; public class User extends RepresentationModel<User> { private Integer id; private String name; private String email; private LocalDateTime createdAt; public Integ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/repository/UserRepository.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoasvsswagger/repository/UserRepository.java
package com.baeldung.hateoasvsswagger.repository; import com.baeldung.hateoasvsswagger.model.NewUser; import com.baeldung.hateoasvsswagger.model.User; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @Repository p...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/services/OrderService.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/services/OrderService.java
package com.baeldung.hateoas.services; import java.util.List; import com.baeldung.hateoas.persistence.model.Order; public interface OrderService { List<Order> getAllOrdersForCustomer(String customerId); Order getOrderByIdForCustomer(String customerId, String orderId); }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/services/CustomerServiceImpl.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/services/CustomerServiceImpl.java
package com.baeldung.hateoas.services; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.springframework.stereotype.Service; import com.baeldung.hateoas.persistence.model.Customer; @Service public class CustomerServiceImpl implements CustomerService { private HashMap<Strin...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/services/OrderServiceImpl.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/services/OrderServiceImpl.java
package com.baeldung.hateoas.services; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.stereotype.Service; import com.baeldung.hateoas.persistence.model.Customer; import com.baeldung.hateoas.persistence.model.Order; @Service public class ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/services/CustomerService.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/services/CustomerService.java
package com.baeldung.hateoas.services; import java.util.List; import com.baeldung.hateoas.persistence.model.Customer; public interface CustomerService { List<Customer> allCustomers(); Customer getCustomerDetail(final String id); }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/util/RestPreconditions.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/util/RestPreconditions.java
package com.baeldung.hateoas.util; import org.springframework.http.HttpStatus; import com.baeldung.hateoas.web.exception.MyResourceNotFoundException; /** * Simple static methods to be called at the start of your own methods to verify correct arguments and state. If the Precondition fails, an {@link HttpStatus} code...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/util/LinkUtil.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/util/LinkUtil.java
package com.baeldung.hateoas.util; import jakarta.servlet.http.HttpServletResponse; /** * Provides some constants and utility methods to build a Link Header to be stored in the {@link HttpServletResponse} object */ public final class LinkUtil { public static final String REL_COLLECTION = "collection"; publ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/IOperations.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/IOperations.java
package com.baeldung.hateoas.persistence; import java.io.Serializable; import java.util.List; public interface IOperations<T extends Serializable> { // read - one T findById(final long id); // read - all List<T> findAll(); // write T create(final T entity); T update(final T entity...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/dao/IFooDao.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/dao/IFooDao.java
package com.baeldung.hateoas.persistence.dao; import org.springframework.data.jpa.repository.JpaRepository; import com.baeldung.hateoas.persistence.model.Foo; public interface IFooDao extends JpaRepository<Foo, Long> { }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/service/IFooService.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/service/IFooService.java
package com.baeldung.hateoas.persistence.service; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import com.baeldung.hateoas.persistence.IOperations; import com.baeldung.hateoas.persistence.model.Foo; public interface IFooService extends IOperations<Foo> { Page...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/service/impl/FooService.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/service/impl/FooService.java
package com.baeldung.hateoas.persistence.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springfram...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/service/common/AbstractService.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/service/common/AbstractService.java
package com.baeldung.hateoas.persistence.service.common; import java.io.Serializable; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.transaction.annotation....
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/model/Foo.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/model/Foo.java
package com.baeldung.hateoas.persistence.model; import java.io.Serializable; import com.thoughtworks.xstream.annotations.XStreamAlias; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/model/Customer.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/model/Customer.java
package com.baeldung.hateoas.persistence.model; import java.util.Map; import org.springframework.hateoas.RepresentationModel; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; @JsonInclude(Include.NON_NULL) public class Customer extends RepresentationM...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/model/Order.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/persistence/model/Order.java
package com.baeldung.hateoas.persistence.model; import org.springframework.hateoas.RepresentationModel; public class Order extends RepresentationModel<Order> { private String orderId; private double price; private int quantity; public Order() { super(); } public Order(final String or...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/event/ResourceCreatedEvent.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/event/ResourceCreatedEvent.java
package com.baeldung.hateoas.event; import org.springframework.context.ApplicationEvent; import jakarta.servlet.http.HttpServletResponse; public class ResourceCreatedEvent extends ApplicationEvent { private final HttpServletResponse response; private final long idOfNewResource; public ResourceCreatedEve...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/event/PaginatedResultsRetrievedEvent.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/event/PaginatedResultsRetrievedEvent.java
package com.baeldung.hateoas.event; import java.io.Serializable; import org.springframework.context.ApplicationEvent; import org.springframework.web.util.UriComponentsBuilder; import jakarta.servlet.http.HttpServletResponse; /** * Event that is fired when a paginated search is performed. * <p/> * This event obje...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/event/SingleResourceRetrievedEvent.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/event/SingleResourceRetrievedEvent.java
package com.baeldung.hateoas.event; import org.springframework.context.ApplicationEvent; import jakarta.servlet.http.HttpServletResponse; public class SingleResourceRetrievedEvent extends ApplicationEvent { private final HttpServletResponse response; public SingleResourceRetrievedEvent(final Object source, ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/listener/SingleResourceRetrievedDiscoverabilityListener.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/listener/SingleResourceRetrievedDiscoverabilityListener.java
package com.baeldung.hateoas.listener; import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import com.baeldung.hateoas.event.SingleResourceRetrievedEvent; import com.baeldung.hateoas.util.L...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/listener/ResourceCreatedDiscoverabilityListener.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/listener/ResourceCreatedDiscoverabilityListener.java
package com.baeldung.hateoas.listener; import java.net.URI; import org.apache.http.HttpHeaders; import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import com.baeldung.hateoas.event.Resour...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/web/controller/FooController.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/web/controller/FooController.java
package com.baeldung.hateoas.web.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.G...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/web/controller/RootController.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/web/controller/RootController.java
package com.baeldung.hateoas.web.controller; import java.net.URI; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.util....
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/web/exception/MyResourceNotFoundException.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/hateoas/web/exception/MyResourceNotFoundException.java
package com.baeldung.hateoas.web.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(value = HttpStatus.NOT_FOUND) public final class MyResourceNotFoundException extends RuntimeException { public MyResourceNotFoundException() { ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/smartdoc/Book.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/smartdoc/Book.java
package com.baeldung.smartdoc; public class Book { /** * Book ID */ private Long id; /** * Author */ private String author; /** * Book Title */ private String title; /** * Book Price */ private Double price; public Book() { } public...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/smartdoc/BookController.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/smartdoc/BookController.java
package com.baeldung.smartdoc; import java.util.List; import jakarta.annotation.Resource; import jakarta.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatusCode; import org.springframework.http.ResponseEntity; import org.springframework.web.bind...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/smartdoc/BookApplication.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/smartdoc/BookApplication.java
package com.baeldung.smartdoc; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class BookApplication { public static void main(String[] args) { SpringApplication.run(BookApplication.class, args); } ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/smartdoc/BookRepository.java
spring-web-modules/spring-boot-rest-2/src/main/java/com/baeldung/smartdoc/BookRepository.java
package com.baeldung.smartdoc; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import org.springframework.stereotype.Repository; @Repository public class BookRepository { private static final Map<Long, Book> books...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/SpringTestConfig.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/SpringTestConfig.java
package com.baeldung; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @EnableAutoConfiguration @ComponentScan("com.baeldung") public class SpringTestConfig { ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/SpringContextTest.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/SpringContextTest.java
package com.baeldung; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import com.baeldung.resttemplate.RestTemplateConfigurationApplication; @SpringBootTest(classes= RestTemplateConfigurationApplication.class) public class SpringContextTest { @Test public void...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/resttemplate/RestTemplateLiveTest.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/resttemplate/RestTemplateLiveTest.java
package com.baeldung.resttemplate; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; impor...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/resttemplate/RestTemplateBasicLiveTest.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/resttemplate/RestTemplateBasicLiveTest.java
package com.baeldung.resttemplate; import java.util.Base64; import static com.baeldung.client.Consts.APPLICATION_PORT; import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.net.URI; import java.util.Arrays; import java.util.Set; import com.baeldung.resttemplate.web.handler.Rest...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/resttemplate/web/service/BarConsumerServiceUnitTest.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/resttemplate/web/service/BarConsumerServiceUnitTest.java
package com.baeldung.resttemplate.web.service; import com.baeldung.resttemplate.web.exception.UnauthorizedException; import com.baeldung.resttemplate.web.model.Bar; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; im...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/mock/EmployeeServiceMockRestServiceServerUnitTest.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/mock/EmployeeServiceMockRestServiceServerUnitTest.java
package com.baeldung.mock; import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; import java.net....
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/mock/EmployeeServiceUnitTest.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/mock/EmployeeServiceUnitTest.java
package com.baeldung.mock; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.AdditionalMatchers.eq; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Moc...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/client/TestRestTemplateBasicLiveTest.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/client/TestRestTemplateBasicLiveTest.java
package com.baeldung.client; import com.baeldung.resttemplate.web.dto.Foo; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Assertions; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.client.RestTemplateBuilde...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/client/Consts.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/client/Consts.java
package com.baeldung.client; public interface Consts { int APPLICATION_PORT = 8082; }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/web/handler/RestTemplateResponseErrorHandlerIntegrationTest.java
spring-web-modules/spring-resttemplate/src/test/java/com/baeldung/web/handler/RestTemplateResponseErrorHandlerIntegrationTest.java
package com.baeldung.web.handler; import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; import or...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java
package com.baeldung.resttemplate; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication @EnableAutoConfiguration public class RestTemplateConfigurationApplic...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/SpringConfig.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/SpringConfig.java
package com.baeldung.resttemplate.configuration; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.Bean; import org.springfra...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java
package com.baeldung.resttemplate.configuration; import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import java.net.URI; import java.util.Collection; import java.util.Map; import com.baeldung.resttemplate.web.dto.Foo; import org.springframework.http.HttpHeaders; import org.springframework.htt...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomRestTemplateCustomizer.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomRestTemplateCustomizer.java
package com.baeldung.resttemplate.configuration; import org.springframework.boot.web.client.RestTemplateCustomizer; import org.springframework.web.client.RestTemplate; /** * customize rest template with an interceptor */ public class CustomRestTemplateCustomizer implements RestTemplateCustomizer { @Override ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomClientHttpRequestInterceptor.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomClientHttpRequestInterceptor.java
package com.baeldung.resttemplate.configuration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpRequest; import org.springframework.http.client.ClientHttpRequestExecution; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http....
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/HelloController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/HelloController.java
package com.baeldung.resttemplate.configuration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.b...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/dto/Foo.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/dto/Foo.java
package com.baeldung.resttemplate.web.dto; import com.thoughtworks.xstream.annotations.XStreamAlias; @XStreamAlias("Foo") public class Foo { private long id; private String name; public Foo() { super(); } public Foo(final String name) { super(); this.name = name; } ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/BarConsumerService.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/BarConsumerService.java
package com.baeldung.resttemplate.web.service; import com.baeldung.resttemplate.web.exception.UnauthorizedException; import com.baeldung.resttemplate.web.handler.RestTemplateResponseErrorHandler; import com.baeldung.resttemplate.web.model.Bar; import org.springframework.beans.factory.annotation.Autowired; import org.s...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Employee.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Employee.java
package com.baeldung.resttemplate.web.model; import java.util.Objects; public class Employee { private String id; private String name; public Employee(String id, String name) { this.id = id; this.name = name; } public Employee() { } ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Bar.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Bar.java
package com.baeldung.resttemplate.web.model; public class Bar { private String id; private String name; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/exception/UnauthorizedException.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/exception/UnauthorizedException.java
package com.baeldung.resttemplate.web.exception; public class UnauthorizedException extends RuntimeException { public UnauthorizedException(String message) { super(message); } }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/exception/NotFoundException.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/exception/NotFoundException.java
package com.baeldung.resttemplate.web.exception; public class NotFoundException extends RuntimeException { }
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/handler/RestTemplateResponseErrorHandler.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/handler/RestTemplateResponseErrorHandler.java
package com.baeldung.resttemplate.web.handler; import java.io.IOException; import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpResponse; import org.springframework.stereotype.Component; import org.springframework.web.client.HttpClientErrorException; import org.springframework....
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/transfer/LoginForm.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/transfer/LoginForm.java
package com.baeldung.transfer; public class LoginForm { private String username; private String password; public LoginForm() { } public LoginForm(String username, String password) { super(); this.username = username; this.password = password; } public String g...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/mock/EmployeeService.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/mock/EmployeeService.java
package com.baeldung.mock; import com.baeldung.resttemplate.web.model.Employee; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/repository/HeavyResourceRepository.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/repository/HeavyResourceRepository.java
package com.baeldung.sampleapp.repository; import java.util.Map; import com.baeldung.sampleapp.web.dto.HeavyResource; import com.baeldung.sampleapp.web.dto.HeavyResourceAddressOnly; public class HeavyResourceRepository { public void save(HeavyResource heavyResource) { } public void save(HeavyResourceAd...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/config/RestClientConfig.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/config/RestClientConfig.java
package com.baeldung.sampleapp.config; import java.util.ArrayList; import java.util.List; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.util.CollectionUtil...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/config/MainApplication.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/config/MainApplication.java
package com.baeldung.sampleapp.config; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @EnableAutoConfigurat...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/config/WebConfig.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/config/WebConfig.java
package com.baeldung.sampleapp.config; import java.text.SimpleDateFormat; import java.util.List; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.con...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/interceptors/RestTemplateHeaderModifierInterceptor.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/interceptors/RestTemplateHeaderModifierInterceptor.java
package com.baeldung.sampleapp.interceptors; import java.io.IOException; import org.springframework.http.HttpRequest; import org.springframework.http.client.ClientHttpRequestExecution; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.ClientHttpResponse; publ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/DeferredResultController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/DeferredResultController.java
package com.baeldung.sampleapp.web.controller; import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.ui.Model; im...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/CompanyController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/CompanyController.java
package com.baeldung.sampleapp.web.controller; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.baeldung.sampleapp.web.dto.Company; @RestController public class CompanyController { ...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/ItemController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/ItemController.java
package com.baeldung.sampleapp.web.controller; import java.util.Date; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.baeldung.sampleapp.web.dto.Item; import com.baeld...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/SimplePostController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/SimplePostController.java
package com.baeldung.sampleapp.web.controller; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bi...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/BarMappingExamplesController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/BarMappingExamplesController.java
package com.baeldung.sampleapp.web.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.a...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java
package com.baeldung.sampleapp.web.controller; import java.util.Collection; import java.util.HashMap; import java.util.Map; import jakarta.servlet.http.HttpServletResponse; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.Pat...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/HeavyResourceController.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/HeavyResourceController.java
package com.baeldung.sampleapp.web.controller; import java.util.Map; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind....
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false
eugenp/tutorials
https://github.com/eugenp/tutorials/blob/4463e58ffb73fe599bac2479abd84598c6e70a1a/spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/dto/Foo.java
spring-web-modules/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/dto/Foo.java
package com.baeldung.sampleapp.web.dto; public class Foo { private long id; private String name; public Foo() { super(); } public Foo(final String name) { super(); this.name = name; } public Foo(final long id, final String name) { super(); this.i...
java
MIT
4463e58ffb73fe599bac2479abd84598c6e70a1a
2026-01-04T14:45:57.069771Z
false