├── .gitignore ├── README.adoc ├── assertj-test-foreign-key-violation ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── assertjtestforeignkeyviolation │ │ │ ├── AssertjTestForeignKeyViolationApplication.java │ │ │ ├── Book.java │ │ │ ├── BookRepository.java │ │ │ ├── Song.java │ │ │ ├── SongRepository.java │ │ │ ├── User.java │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ └── db │ │ └── migration │ │ └── V1.0__init.sql │ └── test │ ├── java │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── assertjtestforeignkeyviolation │ │ └── UserRepositoryTest.java │ └── resources │ └── application-data-jpa-test.properties ├── attribute-converter-vs-embeddable ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── attributeconvertervsembeddable │ │ │ ├── AttributeConverterVsEmbeddableApplication.java │ │ │ ├── attributeconverter │ │ │ ├── Email.java │ │ │ ├── EmailConverter.java │ │ │ ├── NaturalPersonName.java │ │ │ ├── User.java │ │ │ ├── UserId.java │ │ │ └── UserRepository.java │ │ │ └── embeddable │ │ │ ├── Email.java │ │ │ ├── EmbeddableUser.java │ │ │ ├── EmbeddableUserRepository.java │ │ │ ├── NaturalPersonName.java │ │ │ └── UserId.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── attributeconvertervsembeddable │ ├── AttributeConverterVsEmbeddableApplicationTests.java │ ├── attributeconverter │ └── UserRepositoryTest.java │ └── embeddable │ └── EmbeddableUserRepositoryTest.java ├── bootify-taming-thymeleaf ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.md ├── docker-compose.yml ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── bootify │ │ │ │ └── taming_thymeleaf │ │ │ │ ├── HomeController.java │ │ │ │ ├── HtmxErrorController.java │ │ │ │ ├── TamingThymeleafApplication.java │ │ │ │ ├── config │ │ │ │ ├── ActuatorSecurityConfig.java │ │ │ │ ├── CommonSecurityConfig.java │ │ │ │ ├── ControllerConfig.java │ │ │ │ ├── DomainConfig.java │ │ │ │ ├── HttpSecurityConfig.java │ │ │ │ └── LocalDevConfig.java │ │ │ │ ├── controller │ │ │ │ ├── AuthenticationController.java │ │ │ │ └── RegistrationController.java │ │ │ │ ├── model │ │ │ │ ├── AuthenticationRequest.java │ │ │ │ ├── HttpUserDetails.java │ │ │ │ ├── PaginationModel.java │ │ │ │ ├── PaginationStep.java │ │ │ │ ├── RegistrationRequest.java │ │ │ │ ├── SimplePage.java │ │ │ │ └── UserRole.java │ │ │ │ ├── service │ │ │ │ ├── ActuatorUserDetailsService.java │ │ │ │ ├── HttpUserDetailsService.java │ │ │ │ └── RegistrationService.java │ │ │ │ ├── team │ │ │ │ ├── controller │ │ │ │ │ └── TeamController.java │ │ │ │ ├── domain │ │ │ │ │ └── Team.java │ │ │ │ ├── model │ │ │ │ │ └── TeamDTO.java │ │ │ │ ├── repos │ │ │ │ │ └── TeamRepository.java │ │ │ │ └── service │ │ │ │ │ └── TeamService.java │ │ │ │ ├── team_player │ │ │ │ ├── domain │ │ │ │ │ └── TeamPlayer.java │ │ │ │ ├── model │ │ │ │ │ └── PlayerPosition.java │ │ │ │ └── repos │ │ │ │ │ └── TeamPlayerRepository.java │ │ │ │ ├── user │ │ │ │ ├── controller │ │ │ │ │ └── UserController.java │ │ │ │ ├── domain │ │ │ │ │ └── User.java │ │ │ │ ├── model │ │ │ │ │ ├── Gender.java │ │ │ │ │ ├── UserDTO.java │ │ │ │ │ └── UserEmailUnique.java │ │ │ │ ├── repos │ │ │ │ │ └── UserRepository.java │ │ │ │ └── service │ │ │ │ │ └── UserService.java │ │ │ │ └── util │ │ │ │ ├── CustomCollectors.java │ │ │ │ ├── NotFoundException.java │ │ │ │ ├── ReferencedWarning.java │ │ │ │ ├── WebAdvice.java │ │ │ │ └── WebUtils.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── css │ │ │ └── app.css │ │ │ ├── db │ │ │ └── migration │ │ │ │ └── V001__CREATE_INITIAL.sql │ │ │ ├── js │ │ │ └── app.js │ │ │ ├── messages.properties │ │ │ ├── static │ │ │ ├── favicon.ico │ │ │ └── images │ │ │ │ └── logo.png │ │ │ └── templates │ │ │ ├── authentication │ │ │ └── login.html │ │ │ ├── error.html │ │ │ ├── fragments │ │ │ ├── forms.html │ │ │ └── utils.html │ │ │ ├── home │ │ │ └── index.html │ │ │ ├── layout.html │ │ │ ├── registration │ │ │ └── register.html │ │ │ ├── team │ │ │ ├── add.html │ │ │ ├── edit.html │ │ │ └── list.html │ │ │ └── user │ │ │ ├── add.html │ │ │ ├── edit.html │ │ │ └── list.html │ └── test │ │ ├── java │ │ └── io │ │ │ └── bootify │ │ │ └── taming_thymeleaf │ │ │ ├── TamingThymeleafApplicationTest.java │ │ │ └── config │ │ │ └── BaseIT.java │ │ └── resources │ │ └── data │ │ ├── clearAll.sql │ │ ├── teamData.sql │ │ ├── teamPlayerData.sql │ │ └── userData.sql ├── tailwind.config.js └── webpack.config.js ├── bootstraptoggleclone ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── gulpfile.js ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── wimdeblauwe │ │ │ │ └── examples │ │ │ │ └── bootstraptoggleclone │ │ │ │ ├── BootstraptogglecloneApplication.java │ │ │ │ ├── Settings.java │ │ │ │ ├── SettingsController.java │ │ │ │ ├── SettingsFormData.java │ │ │ │ └── SettingsService.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── static │ │ │ └── css │ │ │ │ └── application.css │ │ │ └── templates │ │ │ ├── fragments.html │ │ │ └── settings.html │ └── test │ │ └── java │ │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── bootstraptoggleclone │ │ └── BootstraptogglecloneApplicationTests.java └── tailwind.config.js ├── datajpatests ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── datajpatests │ │ │ ├── Book.java │ │ │ ├── BookRepository.java │ │ │ ├── DataJpaTestsApplication.java │ │ │ ├── Song.java │ │ │ ├── SongRepository.java │ │ │ ├── User.java │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ └── db │ │ └── migration │ │ └── V1.0__init.sql │ └── test │ ├── java │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── datajpatests │ │ ├── BookRepositoryTest.java │ │ └── UserRepositoryTest.java │ └── resources │ └── application-data-jpa-test.properties ├── equals-and-hashcode ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── eah │ │ ├── Book.java │ │ ├── Temperature.java │ │ └── User.java │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── eah │ ├── BookTest.java │ └── TemperatureTest.java ├── error-handling-lib-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── HttpRequests.http ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── errorhandling │ │ │ ├── ErrorHandlingApplication.java │ │ │ ├── inforequest │ │ │ ├── InfoRequest.java │ │ │ ├── InfoRequestNotFoundException.java │ │ │ ├── InfoRequestService.java │ │ │ ├── InfoRequestServiceImpl.java │ │ │ └── web │ │ │ │ ├── CreateInfoRequestRequestBody.java │ │ │ │ └── InfoRequestRestController.java │ │ │ └── supportagent │ │ │ ├── SupportAgent.java │ │ │ ├── SupportAgentNotFoundException.java │ │ │ ├── SupportAgentService.java │ │ │ └── SupportAgentServiceImpl.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── errorhandling │ ├── ErrorHandlingApplicationTests.java │ └── inforequest │ └── web │ ├── InfoRequestRestControllerIntegrationTest.java │ └── InfoRequestRestControllerTest.java ├── error-handling ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── HttpRequests.http ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── errorhandling │ │ │ ├── ErrorHandlingApplication.java │ │ │ ├── inforequest │ │ │ ├── InfoRequest.java │ │ │ ├── InfoRequestNotFoundException.java │ │ │ ├── InfoRequestService.java │ │ │ ├── InfoRequestServiceImpl.java │ │ │ └── web │ │ │ │ ├── CreateInfoRequestRequestBody.java │ │ │ │ └── InfoRequestRestController.java │ │ │ └── supportagent │ │ │ ├── SupportAgent.java │ │ │ ├── SupportAgentNotFoundException.java │ │ │ ├── SupportAgentService.java │ │ │ └── SupportAgentServiceImpl.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── errorhandling │ ├── ErrorHandlingApplicationTests.java │ └── inforequest │ └── web │ ├── InfoRequestRestControllerIntegrationTest.java │ └── InfoRequestRestControllerTest.java ├── form-handling-thymeleaf ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── formhandlingthymeleaf │ │ │ ├── FormHandlingThymeleafApplication.java │ │ │ └── user │ │ │ ├── User.java │ │ │ ├── UserCreationParameters.java │ │ │ ├── UserRepository.java │ │ │ ├── UserService.java │ │ │ ├── UserServiceImpl.java │ │ │ └── web │ │ │ ├── CreateUserFormData.java │ │ │ └── UserController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── users │ │ ├── create.html │ │ └── list.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── formhandlingthymeleaf │ └── FormHandlingThymeleafApplicationTests.java ├── generate-enum-values-spring-rest-docs ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── asciidoc │ │ └── Dayinfo API Documentation.adoc │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── generateenumvaluesspringrestdocs │ │ │ ├── DayInfo.java │ │ │ ├── DayInfoRestController.java │ │ │ ├── GenerateEnumValuesSpringRestDocsApplication.java │ │ │ └── Season.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── generateenumvaluesspringrestdocs │ ├── DayInfoRestControllerDocumentation.java │ └── GenerateEnumValuesSpringRestDocsApplicationTests.java ├── google-charts-thymeleaf ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── googlechartsthymeleaf │ │ │ ├── GoogleChartsThymeleafApplication.java │ │ │ └── RootController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── googlechartsthymeleaf │ └── GoogleChartsThymeleafApplicationTests.java ├── htmx-global-error-handler ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── wimdeblauwe │ │ │ │ └── examples │ │ │ │ └── htmxglobalerrorhandler │ │ │ │ ├── GlobalErrorHandler.java │ │ │ │ ├── HomeController.java │ │ │ │ └── HtmxGlobalErrorHandlerExampleApplication.java │ │ └── resources │ │ │ ├── application-local.properties │ │ │ ├── application.properties │ │ │ ├── static │ │ │ └── css │ │ │ │ └── application.css │ │ │ └── templates │ │ │ ├── fragments.html │ │ │ ├── index.html │ │ │ └── layout │ │ │ └── main.html │ └── test │ │ └── java │ │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── htmxglobalerrorhandler │ │ └── HtmxGlobalErrorHandlerExampleApplicationTests.java └── tailwind.config.js ├── htmx-iot-demo ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── htmxiotdemo │ │ │ ├── AutoRefreshController.java │ │ │ ├── HtmxIotDemoApplication.java │ │ │ ├── IndexController.java │ │ │ ├── IotDevice.java │ │ │ ├── IotDeviceService.java │ │ │ ├── OnLoadController.java │ │ │ ├── RefreshButtonController.java │ │ │ └── StandardThymeleafController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── autorefresh │ │ ├── index.html │ │ └── partials.html │ │ ├── index.html │ │ ├── onload │ │ ├── index.html │ │ └── partials.html │ │ ├── refreshbutton │ │ ├── index.html │ │ └── partials.html │ │ └── standard │ │ ├── index.html │ │ └── partials.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── htmxiotdemo │ └── HtmxIotDemoApplicationTests.java ├── htmx-sse ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── htmxsse │ │ │ ├── HtmxSseApplication.java │ │ │ ├── PdfGenerationController.java │ │ │ ├── PdfGenerator.java │ │ │ ├── ProgressListener.java │ │ │ └── WebSecurityConfiguration.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ └── css │ │ │ └── application.css │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── htmxsse │ └── HtmxSseApplicationTests.java ├── junit5-test-order ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── junit5testorder │ │ │ ├── Junit5TestOrderApplication.java │ │ │ └── user │ │ │ ├── User.java │ │ │ ├── UserRepository.java │ │ │ └── web │ │ │ └── UserController.java │ └── resources │ │ └── application.properties │ └── test │ ├── java │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── junit5testorder │ │ ├── Junit5TestOrderApplicationTests.java │ │ ├── SpringBootTestClassOrderer.java │ │ └── user │ │ ├── UserRepositoryTest.java │ │ ├── UserTest.java │ │ └── web │ │ └── UserControllerTest.java │ └── resources │ └── junit-platform.properties ├── laravel-intermediate-task-list ├── .env.example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── docker-compose.yaml ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── laravelintermediatetasklist │ │ │ ├── LaravelIntermediateTaskListApplication.java │ │ │ ├── LaravelIntermediateTaskListApplicationConfiguration.java │ │ │ ├── RootController.java │ │ │ ├── SeedDatabaseCommandRunner.java │ │ │ ├── infrastructure │ │ │ └── security │ │ │ │ ├── ApplicationUserDetails.java │ │ │ │ ├── DatabaseUserDetailsService.java │ │ │ │ └── WebSecurityConfiguration.java │ │ │ ├── task │ │ │ ├── Task.java │ │ │ ├── TaskRepository.java │ │ │ ├── TaskService.java │ │ │ ├── TaskServiceImpl.java │ │ │ └── web │ │ │ │ ├── CreateTaskParameters.java │ │ │ │ └── TaskController.java │ │ │ └── user │ │ │ ├── User.java │ │ │ ├── UserNotFoundException.java │ │ │ ├── UserRepository.java │ │ │ ├── UserService.java │ │ │ ├── UserServiceImpl.java │ │ │ └── web │ │ │ └── UserController.java │ └── resources │ │ ├── application.properties │ │ ├── db │ │ └── migration │ │ │ └── V1.0__init.sql │ │ └── templates │ │ ├── fragments │ │ └── messages.html │ │ ├── layouts │ │ └── app.html │ │ ├── login.html │ │ ├── task │ │ └── index.html │ │ └── welcome.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── laravelintermediatetasklist │ └── LaravelIntermediateTaskListApplicationTests.java ├── live-reload-dev-tools ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── livereloaddevtools │ │ │ ├── IndexController.java │ │ │ └── LiveReloadDevToolsApplication.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ └── application.css │ │ └── js │ │ │ └── test.js │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── livereloaddevtools │ └── LiveReloadDevToolsApplicationTests.java ├── live-reload-npm-scripts-tailwindcss ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── copy-files.js ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── wimdeblauwe │ │ │ │ └── examples │ │ │ │ └── livereloadnpmscriptstailwindcss │ │ │ │ ├── IndexController.java │ │ │ │ └── LiveReloadNpmScriptsTailwindCssApplication.java │ │ └── resources │ │ │ ├── application-local.properties.example │ │ │ ├── application.properties │ │ │ ├── static │ │ │ ├── css │ │ │ │ └── application.css │ │ │ └── js │ │ │ │ └── test.js │ │ │ └── templates │ │ │ └── index.html │ └── test │ │ └── java │ │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── livereloadnpmscriptstailwindcss │ │ └── LiveReloadNpmScriptsTailwindCssApplicationTests.java └── tailwind.config.js ├── live-reload-npm-scripts ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── copy-files.js ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── livereloadnpmscripts │ │ │ ├── IndexController.java │ │ │ └── LiveReloadNpmScriptsApplication.java │ └── resources │ │ ├── application-local.properties.example │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ └── application.css │ │ └── js │ │ │ └── test.js │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── livereloadnpmscripts │ └── LiveReloadNpmScriptsApplicationTests.java ├── pk-uuid └── HELP.md ├── primary-key-object ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── HELP.md ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── primarykeyobject │ │ │ ├── PrimaryKeyObjectApplication.java │ │ │ ├── infrastructure │ │ │ └── jpa │ │ │ │ ├── AbstractLongEntityId.java │ │ │ │ ├── AbstractLongEntityIdIdentifierGenerator.java │ │ │ │ ├── Entity.java │ │ │ │ └── EntityId.java │ │ │ ├── order │ │ │ ├── Order.java │ │ │ ├── OrderId.java │ │ │ ├── OrderIdIdentifierGenerator.java │ │ │ ├── OrderRepository.java │ │ │ └── OrderService.java │ │ │ └── user │ │ │ ├── User.java │ │ │ ├── UserId.java │ │ │ ├── UserIdIdentifierGenerator.java │ │ │ └── UserRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── primarykeyobject │ ├── MultiRepositoryTest.java │ ├── PrimaryKeyObjectApplicationTests.java │ ├── order │ └── OrderRepositoryTest.java │ └── user │ └── UserRepositoryTest.java ├── reactive-error-handling ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── reactiveerrorhandling │ │ │ ├── ExceptionWithBadRequestStatus.java │ │ │ ├── MyRestController.java │ │ │ ├── ReactiveErrorHandlingApplication.java │ │ │ ├── User.java │ │ │ ├── UserNotFoundException.java │ │ │ └── UserService.java │ └── resources │ │ └── application.properties │ └── test │ ├── http │ └── HttpTest.http │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── reactiveerrorhandling │ ├── MyRestControllerTest.java │ └── ReactiveErrorHandlingApplicationTests.java ├── redirect-attributes ├── .gitattributes ├── .gitignore ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── wimdeblauwe │ │ │ │ └── examples │ │ │ │ └── redirect_attributes │ │ │ │ ├── HomeController.java │ │ │ │ ├── RedirectAttributesDemoApplication.java │ │ │ │ └── product │ │ │ │ ├── Product.java │ │ │ │ └── web │ │ │ │ ├── CreateProductFormData.java │ │ │ │ ├── ProductController.java │ │ │ │ └── ProductRepository.java │ │ └── resources │ │ │ ├── application-local.properties │ │ │ ├── application.properties │ │ │ ├── static │ │ │ └── css │ │ │ │ └── application.css │ │ │ └── templates │ │ │ ├── fragments.html │ │ │ ├── index.html │ │ │ ├── layout │ │ │ └── main.html │ │ │ └── products │ │ │ ├── edit.html │ │ │ └── index.html │ └── test │ │ └── java │ │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── redirect_attributes │ │ └── RedirectAttributesDemoApplicationTests.java ├── tailwind.config.js └── vite.config.js ├── request-parameters-validation ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── requestparametersvalidation │ │ │ ├── FromMoreRecentThenTo.java │ │ │ ├── FromMoreRecentThenToValidator.java │ │ │ ├── GetTaskRequestParameters.java │ │ │ ├── RequestParametersValidationApplication.java │ │ │ ├── Task.java │ │ │ └── TaskRestController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── requestparametersvalidation │ └── RequestParametersValidationApplicationTests.java ├── shoelace-thymeleaf-alpine ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── deblauwe │ │ │ │ └── examples │ │ │ │ └── shoelacethymeleafalpine │ │ │ │ ├── HomeController.java │ │ │ │ └── ShoelaceThymeleafAlpineDemoApplication.java │ │ └── resources │ │ │ ├── application-local.properties │ │ │ ├── application.properties │ │ │ ├── i18n │ │ │ ├── messages.properties │ │ │ └── messages_nl.properties │ │ │ ├── static │ │ │ └── css │ │ │ │ └── application.css │ │ │ └── templates │ │ │ ├── fragments │ │ │ └── toasts.html │ │ │ ├── index.html │ │ │ └── layout │ │ │ └── main.html │ └── test │ │ └── java │ │ └── com │ │ └── deblauwe │ │ └── examples │ │ └── shoelacethymeleaf │ │ └── ShoelaceThymeleafAlpineDemoApplicationTests.java └── tailwind.config.js ├── shoelace-thymeleaf ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── deblauwe │ │ │ │ └── examples │ │ │ │ └── shoelacethymeleaf │ │ │ │ ├── HomeController.java │ │ │ │ └── ShoelaceThymeleafDemoApplication.java │ │ └── resources │ │ │ ├── application-local.properties │ │ │ ├── application.properties │ │ │ ├── static │ │ │ └── css │ │ │ │ └── application.css │ │ │ └── templates │ │ │ ├── index.html │ │ │ └── layout │ │ │ └── main.html │ └── test │ │ └── java │ │ └── com │ │ └── deblauwe │ │ └── examples │ │ └── shoelacethymeleaf │ │ └── ShoelaceThymeleafDemoApplicationTests.java └── tailwind.config.js ├── slidev-example ├── .gitignore ├── .npmrc ├── README.md ├── components │ ├── Counter.vue │ └── FirefoxLogo.svg ├── global-bottom.vue ├── images │ └── tools.jpg ├── layouts │ └── three-icons.vue ├── netlify.toml ├── package.json ├── pages │ └── imported-slides.md ├── pnpm-lock.yaml ├── setup │ └── main.ts ├── slides.md ├── snippets │ └── external.ts ├── style.css └── vercel.json ├── spring-boot-test-slices ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── springboottestslices │ │ │ ├── SpringBootTestSlicesApplication.java │ │ │ └── album │ │ │ ├── Album.java │ │ │ └── AlbumRepository.java │ └── resources │ │ ├── application.properties │ │ └── db │ │ └── migration │ │ └── V1.0__init.sql │ └── test │ ├── java │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── springboottestslices │ │ ├── SpringBootTestSlicesApplicationTests.java │ │ ├── album │ │ └── AlbumRepositoryTest.java │ │ └── infrastructure │ │ └── test │ │ ├── MyAppDataJpaTest.java │ │ └── MyAppDataJpaTestConfiguration.java │ └── resources │ └── application-data-jpa-test.properties ├── testcontainers-cypress-0.4.0-example ├── .gitignore ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── testcontainerscypressexample │ │ │ ├── TestcontainersCypressExampleApplication.java │ │ │ ├── infrastructure │ │ │ └── test │ │ │ │ └── IntegrationTestRestController.java │ │ │ └── todo │ │ │ ├── Todo.java │ │ │ ├── TodoService.java │ │ │ └── web │ │ │ └── TodoController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── todo-list.html │ └── test │ ├── e2e │ ├── cypress.json │ ├── cypress │ │ ├── fixtures │ │ │ └── example.json │ │ ├── integration │ │ │ └── todos.spec.js │ │ ├── plugins │ │ │ └── index.js │ │ └── support │ │ │ ├── commands.js │ │ │ └── index.js │ ├── package.json │ └── reporter-config.json │ ├── java │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── testcontainerscypressexample │ │ ├── TestcontainersCypressExampleApplicationTests.java │ │ └── todo │ │ └── web │ │ └── TodoControllerCypressIntegrationTest.java │ └── resources │ └── logback-test.xml ├── testcontainers-cypress-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── testcontainerscypressexample │ │ │ ├── TestcontainersCypressExampleApplication.java │ │ │ ├── infrastructure │ │ │ └── test │ │ │ │ └── IntegrationTestRestController.java │ │ │ └── todo │ │ │ ├── Todo.java │ │ │ ├── TodoService.java │ │ │ └── web │ │ │ └── TodoController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── todo-list.html │ └── test │ ├── e2e │ ├── cypress.json │ ├── cypress │ │ ├── fixtures │ │ │ └── example.json │ │ ├── integration │ │ │ └── todos.spec.js │ │ ├── plugins │ │ │ └── index.js │ │ └── support │ │ │ ├── commands.js │ │ │ └── index.js │ ├── package-lock.json │ ├── package.json │ └── reporter-config.json │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── testcontainerscypressexample │ ├── TestcontainersCypressExampleApplicationTests.java │ └── todo │ └── web │ └── TodoControllerCypressIntegrationTest.java ├── testcontainers-multiple-services ├── testcontainers-docker-compose │ ├── .gitattributes │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ └── maven-wrapper.properties │ ├── compose.yaml │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── wimdeblauwe │ │ │ │ └── examples │ │ │ │ └── testcontainers_docker_compose │ │ │ │ ├── Bicycle.java │ │ │ │ ├── BicycleRepository.java │ │ │ │ ├── CreateBicycleUseCase.java │ │ │ │ ├── KafkaConfiguration.java │ │ │ │ ├── TestcontainersDockerComposeApplication.java │ │ │ │ ├── User.java │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── db │ │ │ └── migration │ │ │ └── V1.0.0__init.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── testcontainers_docker_compose │ │ ├── BicycleRepositoryTest.java │ │ ├── CreateBicycleUseCaseTest.java │ │ ├── IntegrationTestConfiguration.java │ │ ├── IntegrationTestInitializer.java │ │ ├── MyAppDataJpaTest.java │ │ ├── MyAppSpringBootTest.java │ │ ├── TestcontainersDockerComposeApplicationTests.java │ │ └── UserRepositoryTest.java └── testcontainers-multiple-configurations │ ├── .gitattributes │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── testcontainers_multiple_configurations │ │ │ ├── Bicycle.java │ │ │ ├── BicycleRepository.java │ │ │ ├── CreateBicycleUseCase.java │ │ │ ├── KafkaConfiguration.java │ │ │ ├── TestcontainersMultipleInitializersApplication.java │ │ │ ├── User.java │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ └── db │ │ └── migration │ │ └── V1.0.0__init.sql │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── testcontainers_multiple_configurations │ ├── BicycleRepositoryTest.java │ ├── CreateBicycleUseCaseTest.java │ ├── DataJpaTestcontainersConfiguration.java │ ├── MyAppDataJpaTest.java │ ├── MyAppSpringBootTest.java │ ├── TestTestcontainersMultipleInitializersApplication.java │ ├── TestcontainersConfiguration.java │ ├── TestcontainersMultipleInitializersApplicationTests.java │ └── UserRepositoryTest.java ├── thymeleaf-google-login ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── deblauwe │ │ │ └── examples │ │ │ └── thymeleafgooglelogin │ │ │ ├── HomeController.java │ │ │ ├── ThymeleafGoogleLoginApplication.java │ │ │ └── WebSecurityConfiguration.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── deblauwe │ └── examples │ └── thymeleafgooglelogin │ └── ThymeleafGoogleLoginApplicationTests.java ├── thymeleaf-htmx-auth-error-handling ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── thymeleafhtmxautherrorhandling │ │ │ ├── ChuckNorrisJoke.java │ │ │ ├── ChuckNorrisJokesApiClient.java │ │ │ ├── ChuckNorrisJokesApiClientProperties.java │ │ │ ├── HxRefreshHeaderAuthenticationEntryPoint.java │ │ │ ├── RestClientConfiguration.java │ │ │ ├── RootController.java │ │ │ ├── ThymeleafHtmxAuthErrorHandlingApplication.java │ │ │ └── WebSecurityConfiguration.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ └── css │ │ │ └── application.css │ │ └── templates │ │ ├── fragments.html │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── thymeleafhtmxautherrorhandling │ └── ThymeleafHtmxAuthErrorHandlingApplicationTests.java ├── thymeleaf-iteration-fragments ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── thymeleafiterationfragments │ │ │ ├── IndexController.java │ │ │ └── ThymeleafIterationFragmentsApplication.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── fragments.html │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── thymeleafiterationfragments │ └── ThymeleafIterationFragmentsApplicationTests.java ├── thymeleaf-live-reload ├── HELP.md ├── README.adoc ├── gulpfile.js ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── thymeleaflivereload │ │ │ ├── HomeController.java │ │ │ └── ThymeleafLiveReloadApplication.java │ └── resources │ │ ├── application-live.properties │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ └── application.css │ │ └── js │ │ │ └── application.js │ │ └── templates │ │ └── home.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── thymeleaflivereload │ └── ThymeleafLiveReloadApplicationTests.java ├── thymeleaf-react ├── .gitignore ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── wimdeblauwe │ │ │ │ └── examples │ │ │ │ └── thymeleaf_react │ │ │ │ ├── HomeController.java │ │ │ │ └── ThymeleafReactDemoApplication.java │ │ └── resources │ │ │ ├── application-local.properties │ │ │ ├── application.properties │ │ │ ├── messages.properties │ │ │ ├── messages_nl.properties │ │ │ ├── static │ │ │ ├── css │ │ │ │ └── application.css │ │ │ └── react │ │ │ │ ├── ButtonBar.tsx │ │ │ │ ├── FlowbiteExample.tsx │ │ │ │ ├── ListExample.tsx │ │ │ │ └── OccurrencesTimeline.tsx │ │ │ └── templates │ │ │ ├── index.html │ │ │ ├── layout │ │ │ └── main.html │ │ │ └── timeline.html │ └── test │ │ └── java │ │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── thymeleaf_react │ │ └── ThymeleafReactDemoApplicationTests.java ├── tailwind.config.js ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.node.json └── vite.config.js ├── thymeleaf-web-components ├── .gitignore ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── postcss.config.js ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── wimdeblauwe │ │ │ │ └── examples │ │ │ │ └── thymeleaf_web_components │ │ │ │ ├── HomeController.java │ │ │ │ └── ThymeleafWebComponentsApplication.java │ │ └── resources │ │ │ ├── application-local.properties │ │ │ ├── application.properties │ │ │ ├── static │ │ │ ├── css │ │ │ │ └── application.css │ │ │ └── wc │ │ │ │ ├── button │ │ │ │ ├── button.component.scss │ │ │ │ └── button.ts │ │ │ │ └── scss.d.ts │ │ │ └── templates │ │ │ ├── index.html │ │ │ └── layout │ │ │ └── main.html │ └── test │ │ └── java │ │ └── com │ │ └── wimdeblauwe │ │ └── examples │ │ └── thymeleaf_web_components │ │ └── ThymeleafWebComponentsApplicationTests.java ├── tailwind.config.js ├── tsconfig.json └── vite.config.js ├── thymeleaf-with-records ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── thymeleafwithrecords │ │ │ ├── Person.java │ │ │ ├── TestController.java │ │ │ └── ThymeleafWithRecordsApplication.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── thymeleafwithrecords │ └── ThymeleafWithRecordsApplicationTests.java ├── thymeleaf-with-tailwind-css ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.adoc ├── gulpfile.js ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── thymeleafwithtailwindcss │ │ │ ├── ThymeleafWithTailwindCssApplication.java │ │ │ ├── Todo.java │ │ │ └── TodoController.java │ └── resources │ │ ├── application-live.properties │ │ ├── application.properties │ │ ├── static │ │ └── css │ │ │ └── application.css │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── thymeleafwithtailwindcss │ └── ThymeleafWithTailwindCssApplicationTests.java ├── todomvc-htmx-boost ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── todomvchtmx │ │ │ ├── TodomvcThymeleafHtmxBoostApplication.java │ │ │ └── todoitem │ │ │ ├── TodoItem.java │ │ │ ├── TodoItemNotFoundException.java │ │ │ ├── TodoItemRepository.java │ │ │ └── web │ │ │ ├── TodoItemController.java │ │ │ └── TodoItemFormData.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── fragments.html │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── todomvchtmx │ └── TodomvcThymeleafHtmxBoostApplicationTests.java ├── todomvc-htmx-oob ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── todomvchtmx │ │ │ ├── TodomvcThymeleafHtmxOobApplication.java │ │ │ └── todoitem │ │ │ ├── TodoItem.java │ │ │ ├── TodoItemNotFoundException.java │ │ │ ├── TodoItemRepository.java │ │ │ └── web │ │ │ ├── TodoItemController.java │ │ │ └── TodoItemFormData.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── fragments.html │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── todomvchtmx │ └── TodomvcThymeleafHtmxApplicationTests.java ├── todomvc-htmx ├── HELP.md ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── todomvchtmx │ │ │ ├── TodomvcThymeleafHtmxApplication.java │ │ │ └── todoitem │ │ │ ├── TodoItem.java │ │ │ ├── TodoItemNotFoundException.java │ │ │ ├── TodoItemRepository.java │ │ │ └── web │ │ │ ├── TodoItemController.java │ │ │ └── TodoItemFormData.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── fragments.html │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── todomvchtmx │ └── TodomvcThymeleafHtmxApplicationTests.java ├── todomvc-thymeleaf ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── todomvcthymeleaf │ │ │ ├── TodomvcThymeleafApplication.java │ │ │ └── todoitem │ │ │ ├── TodoItem.java │ │ │ ├── TodoItemNotFoundException.java │ │ │ ├── TodoItemRepository.java │ │ │ └── web │ │ │ ├── TodoItemController.java │ │ │ └── TodoItemFormData.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── fragments.html │ │ └── index.html │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── todomvcthymeleaf │ └── TodomvcThymeleafApplicationTests.java ├── transactional-outbox-spring-integration-json ├── .gitignore ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── compose.yaml ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── transactional_outbox_spring_integration_json │ │ │ ├── TransactionalOutboxSpringIntegrationJsonApplication.java │ │ │ ├── infrastructure │ │ │ ├── integration │ │ │ │ └── SpringIntegrationConfiguration.java │ │ │ └── mail │ │ │ │ ├── LoggingMailSender.java │ │ │ │ ├── MailConfigration.java │ │ │ │ ├── MailGateway.java │ │ │ │ ├── MailMessage.java │ │ │ │ └── MailSender.java │ │ │ └── order │ │ │ ├── Order.java │ │ │ ├── repository │ │ │ └── OrderRepository.java │ │ │ ├── usecase │ │ │ └── CompleteOrder.java │ │ │ └── web │ │ │ └── OrderRestController.java │ └── resources │ │ ├── application.properties │ │ └── db │ │ └── migration │ │ ├── V1.0.0__spring_integration_tables.sql │ │ └── V1.0.1__orders.sql │ └── test │ ├── http │ └── requests.http │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── transactional_outbox_spring_integration_json │ ├── TestTransactionalOutboxSpringIntegrationJsonApplication.java │ ├── TestcontainersConfiguration.java │ └── TransactionalOutboxSpringIntegrationJsonApplicationTests.java ├── transactional-outbox-spring-integration-oracle ├── .gitignore ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── compose.yaml ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── transactional_outbox_spring_integration │ │ │ ├── TransactionalOutboxSpringIntegrationOracleApplication.java │ │ │ ├── infrastructure │ │ │ ├── integration │ │ │ │ └── SpringIntegrationConfiguration.java │ │ │ └── mail │ │ │ │ ├── LoggingMailSender.java │ │ │ │ ├── MailConfigration.java │ │ │ │ ├── MailGateway.java │ │ │ │ ├── MailMessage.java │ │ │ │ └── MailSender.java │ │ │ └── order │ │ │ ├── Order.java │ │ │ ├── repository │ │ │ └── OrderRepository.java │ │ │ ├── usecase │ │ │ └── CompleteOrder.java │ │ │ └── web │ │ │ └── OrderRestController.java │ └── resources │ │ ├── application.properties │ │ └── db │ │ └── migration │ │ ├── V1.0.0__spring_integration_tables.sql │ │ └── V1.0.1__orders.sql │ └── test │ ├── http │ └── requests.http │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── transactional_outbox_spring_integration │ ├── TestTransactionalOutboxSpringIntegrationOracleApplication.java │ ├── TestcontainersConfiguration.java │ └── TransactionalOutboxSpringIntegrationOracleApplicationTests.java ├── transactional-outbox-spring-integration ├── .gitignore ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── compose.yaml ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── transactional_outbox_spring_integration │ │ │ ├── TransactionalOutboxSpringIntegrationApplication.java │ │ │ ├── infrastructure │ │ │ ├── integration │ │ │ │ └── SpringIntegrationConfiguration.java │ │ │ └── mail │ │ │ │ ├── LoggingMailSender.java │ │ │ │ ├── MailConfigration.java │ │ │ │ ├── MailGateway.java │ │ │ │ ├── MailMessage.java │ │ │ │ └── MailSender.java │ │ │ └── order │ │ │ ├── Order.java │ │ │ ├── repository │ │ │ └── OrderRepository.java │ │ │ ├── usecase │ │ │ └── CompleteOrder.java │ │ │ └── web │ │ │ └── OrderRestController.java │ └── resources │ │ ├── application.properties │ │ └── db │ │ └── migration │ │ ├── V1.0.0__spring_integration_tables.sql │ │ └── V1.0.1__orders.sql │ └── test │ ├── http │ └── requests.http │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── transactional_outbox_spring_integration │ ├── TestTransactionalOutboxSpringIntegrationApplication.java │ ├── TestcontainersConfiguration.java │ └── TransactionalOutboxSpringIntegrationApplicationTests.java ├── transactional-outbox-spring-modulith ├── .gitignore ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── compose.yaml ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── transactional_outbox_spring_modulith │ │ │ ├── TransactionalOutboxSpringModulithApplication.java │ │ │ ├── infrastructure │ │ │ └── mail │ │ │ │ ├── LoggingMailSender.java │ │ │ │ ├── MailMessage.java │ │ │ │ └── MailSender.java │ │ │ ├── notification │ │ │ └── MailNotifier.java │ │ │ └── order │ │ │ ├── Order.java │ │ │ ├── OrderCompleted.java │ │ │ ├── repository │ │ │ └── OrderRepository.java │ │ │ ├── usecase │ │ │ └── CompleteOrder.java │ │ │ └── web │ │ │ └── OrderRestController.java │ └── resources │ │ ├── application.properties │ │ └── db │ │ └── migration │ │ ├── V1.0.0__spring-modulith-event-publication.sql │ │ └── V1.0.1__orders.sql │ └── test │ ├── http │ └── requests.http │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── transactional_outbox_spring_modulith │ └── TransactionalOutboxSpringModulithApplicationTests.java ├── value-objects-with-rest-api-uuid ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── valueobjectswithrestapiuuid │ │ │ ├── ValueObjectsWithRestApiUuidApplication.java │ │ │ ├── todo │ │ │ ├── CreateTodoParameters.java │ │ │ └── web │ │ │ │ └── TodoController.java │ │ │ └── user │ │ │ ├── StringToUserIdConverter.java │ │ │ ├── UserId.java │ │ │ └── web │ │ │ ├── UserController.java │ │ │ └── UserInfo.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── valueobjectswithrestapiuuid │ ├── ValueObjectsWithRestApiUuidApplicationTests.java │ ├── todo │ ├── CreateTodoParametersTest.java │ └── web │ │ └── TodoControllerTest.java │ └── user │ └── web │ └── UserControllerTest.java ├── value-objects-with-rest-api ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── wimdeblauwe │ │ │ └── examples │ │ │ └── valueobjectswithrestapi │ │ │ ├── ValueObjectsWithRestApiApplication.java │ │ │ ├── todo │ │ │ ├── CreateTodoParameters.java │ │ │ └── web │ │ │ │ └── TodoController.java │ │ │ └── user │ │ │ ├── StringToUserIdConverter.java │ │ │ ├── UserId.java │ │ │ └── web │ │ │ ├── UserController.java │ │ │ └── UserInfo.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── wimdeblauwe │ └── examples │ └── valueobjectswithrestapi │ ├── ValueObjectsWithRestApiApplicationTests.java │ ├── todo │ ├── CreateTodoParametersTest.java │ └── web │ │ └── TodoControllerTest.java │ └── user │ └── web │ └── UserControllerTest.java └── viewcomponent-demo └── HELP.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | 4 | .classpath 5 | .project 6 | .settings/ 7 | 8 | target/ 9 | node_modules/ 10 | node 11 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = Example code blog wimdeblauwe.com 2 | 3 | This repository has the example code for blog posts on https://www.wimdeblauwe.com. 4 | 5 | Each directory has a `README.adoc` detailing more about the example and a link to the corresponding blog post. 6 | -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/assertj-test-foreign-key-violation/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/README.adoc: -------------------------------------------------------------------------------- 1 | = AssertJ test cause of exception 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2020/05/08/assertj-test-cause-of-exception/[AssertJ test cause of exception] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.2.7 11 | 12 | == Running 13 | 14 | Run: 15 | [source] 16 | ---- 17 | mvn test 18 | ---- -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/src/main/java/com/wimdeblauwe/examples/assertjtestforeignkeyviolation/AssertjTestForeignKeyViolationApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.assertjtestforeignkeyviolation; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class AssertjTestForeignKeyViolationApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(AssertjTestForeignKeyViolationApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/src/main/java/com/wimdeblauwe/examples/assertjtestforeignkeyviolation/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.assertjtestforeignkeyviolation; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface BookRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/src/main/java/com/wimdeblauwe/examples/assertjtestforeignkeyviolation/SongRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.assertjtestforeignkeyviolation; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface SongRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/src/main/java/com/wimdeblauwe/examples/assertjtestforeignkeyviolation/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.assertjtestforeignkeyviolation; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface UserRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.open-in-view=false -------------------------------------------------------------------------------- /assertj-test-foreign-key-violation/src/test/resources/application-data-jpa-test.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:tc:postgresql:12:///testdb?TC_TMPFS=/testtmpfs:rw 2 | spring.datasource.driver-class-name=org.testcontainers.jdbc.ContainerDatabaseDriver 3 | spring.datasource.username=user 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect 6 | spring.jpa.hibernate.ddl-auto=validate 7 | -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/attribute-converter-vs-embeddable/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/src/main/java/com/wimdeblauwe/examples/attributeconvertervsembeddable/AttributeConverterVsEmbeddableApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.attributeconvertervsembeddable; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class AttributeConverterVsEmbeddableApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(AttributeConverterVsEmbeddableApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/src/main/java/com/wimdeblauwe/examples/attributeconvertervsembeddable/attributeconverter/Email.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.attributeconvertervsembeddable.attributeconverter; 2 | 3 | import org.springframework.util.Assert; 4 | 5 | public class Email { 6 | private final String value; 7 | 8 | public Email(String value) { 9 | Assert.hasText(value, "value should have text"); 10 | this.value = value; 11 | } 12 | 13 | public String getValue() { 14 | return value; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/src/main/java/com/wimdeblauwe/examples/attributeconvertervsembeddable/attributeconverter/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.attributeconvertervsembeddable.attributeconverter; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.Optional; 7 | 8 | @Repository("acUserRepository") 9 | public interface UserRepository extends CrudRepository { 10 | 11 | Optional findByPersonalEmail(Email email); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/src/main/java/com/wimdeblauwe/examples/attributeconvertervsembeddable/embeddable/EmbeddableUserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.attributeconvertervsembeddable.embeddable; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import java.util.Optional; 6 | 7 | public interface EmbeddableUserRepository extends CrudRepository { 8 | Optional findByPersonalEmail(Email email); 9 | } 10 | -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /attribute-converter-vs-embeddable/src/test/java/com/wimdeblauwe/examples/attributeconvertervsembeddable/AttributeConverterVsEmbeddableApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.attributeconvertervsembeddable; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AttributeConverterVsEmbeddableApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/bootify-taming-thymeleaf/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | postgres: 3 | image: postgres:16.1 4 | environment: 5 | - POSTGRES_DB=taming-thymeleaf 6 | - POSTGRES_USER=postgres 7 | - POSTGRES_PASSWORD=P4ssword! 8 | ports: 9 | - 5433:5432 10 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/java/io/bootify/taming_thymeleaf/HomeController.java: -------------------------------------------------------------------------------- 1 | package io.bootify.taming_thymeleaf; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | 7 | @Controller 8 | public class HomeController { 9 | 10 | @GetMapping("/") 11 | public String index() { 12 | return "home/index"; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/java/io/bootify/taming_thymeleaf/TamingThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package io.bootify.taming_thymeleaf; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | 7 | @SpringBootApplication 8 | public class TamingThymeleafApplication { 9 | 10 | public static void main(final String[] args) { 11 | SpringApplication.run(TamingThymeleafApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/java/io/bootify/taming_thymeleaf/model/UserRole.java: -------------------------------------------------------------------------------- 1 | package io.bootify.taming_thymeleaf.model; 2 | 3 | 4 | public enum UserRole { 5 | 6 | USER, 7 | ADMIN; 8 | 9 | public class Fields { 10 | 11 | public static final String USER = "USER"; 12 | public static final String ADMIN = "ADMIN"; 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/java/io/bootify/taming_thymeleaf/team_player/model/PlayerPosition.java: -------------------------------------------------------------------------------- 1 | package io.bootify.taming_thymeleaf.team_player.model; 2 | 3 | 4 | public enum PlayerPosition { 5 | 6 | POINT_GUARD, 7 | SHOOTING_GUARD, 8 | SMALL_FORWARD, 9 | POWER_FORWARD, 10 | CENTER 11 | 12 | } 13 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/java/io/bootify/taming_thymeleaf/user/model/Gender.java: -------------------------------------------------------------------------------- 1 | package io.bootify.taming_thymeleaf.user.model; 2 | 3 | 4 | public enum Gender { 5 | 6 | MALE, 7 | FEMALE, 8 | OTHER, 9 | UNKNOWN 10 | 11 | } 12 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/java/io/bootify/taming_thymeleaf/user/repos/UserRepository.java: -------------------------------------------------------------------------------- 1 | package io.bootify.taming_thymeleaf.user.repos; 2 | 3 | import io.bootify.taming_thymeleaf.user.domain.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | 7 | public interface UserRepository extends JpaRepository { 8 | 9 | User findByEmailIgnoreCase(String email); 10 | 11 | boolean existsByEmailIgnoreCase(String email); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/java/io/bootify/taming_thymeleaf/util/NotFoundException.java: -------------------------------------------------------------------------------- 1 | package io.bootify.taming_thymeleaf.util; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | 7 | @ResponseStatus(HttpStatus.NOT_FOUND) 8 | public class NotFoundException extends RuntimeException { 9 | 10 | public NotFoundException() { 11 | super(); 12 | } 13 | 14 | public NotFoundException(final String message) { 15 | super(message); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | @import '~flatpickr/dist/flatpickr'; 5 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/bootify-taming-thymeleaf/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/resources/static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/bootify-taming-thymeleaf/src/main/resources/static/images/logo.png -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | [[${status}]] - [[${error}]] 6 | 7 | 8 |
9 |

[[${status}]] - [[${error}]]

10 |

[[#{error.message}]]

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/test/java/io/bootify/taming_thymeleaf/TamingThymeleafApplicationTest.java: -------------------------------------------------------------------------------- 1 | package io.bootify.taming_thymeleaf; 2 | 3 | import io.bootify.taming_thymeleaf.config.BaseIT; 4 | import org.junit.jupiter.api.Test; 5 | 6 | 7 | public class TamingThymeleafApplicationTest extends BaseIT { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/test/resources/data/clearAll.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM team_player; 2 | 3 | DELETE FROM team; 4 | 5 | DELETE FROM "user"; 6 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/test/resources/data/teamData.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO team ( 2 | id, 3 | name, 4 | coach_id 5 | ) VALUES ( 6 | 1100, 7 | 'Duis autem vel.', 8 | 1000 9 | ); 10 | 11 | INSERT INTO team ( 12 | id, 13 | name, 14 | coach_id 15 | ) VALUES ( 16 | 1101, 17 | 'Ut wisi enim.', 18 | 1001 19 | ); 20 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/src/test/resources/data/teamPlayerData.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO team_player ( 2 | id, 3 | position, 4 | player_id, 5 | team_id 6 | ) VALUES ( 7 | 1200, 8 | 'POINT_GUARD', 9 | 1000, 10 | 1100 11 | ); 12 | 13 | INSERT INTO team_player ( 14 | id, 15 | position, 16 | player_id, 17 | team_id 18 | ) VALUES ( 19 | 1201, 20 | 'POINT_GUARD', 21 | 1001, 22 | 1101 23 | ); 24 | -------------------------------------------------------------------------------- /bootify-taming-thymeleaf/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: ["./src/main/resources/**/*.{html,js}"], 3 | safelist: [ 4 | 'underline' 5 | ], 6 | theme: { 7 | extend: {}, 8 | container: { 9 | center: true, 10 | } 11 | }, 12 | plugins: [ 13 | require('@tailwindcss/forms') 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /bootstraptoggleclone/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /bootstraptoggleclone/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/bootstraptoggleclone/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /bootstraptoggleclone/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /bootstraptoggleclone/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /bootstraptoggleclone/src/main/java/com/wimdeblauwe/examples/bootstraptoggleclone/BootstraptogglecloneApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.bootstraptoggleclone; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BootstraptogglecloneApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BootstraptogglecloneApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /bootstraptoggleclone/src/main/java/com/wimdeblauwe/examples/bootstraptoggleclone/Settings.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.bootstraptoggleclone; 2 | 3 | public record Settings(boolean notifyViaEmail, 4 | boolean notifyViaSms) { 5 | } 6 | -------------------------------------------------------------------------------- /bootstraptoggleclone/src/main/java/com/wimdeblauwe/examples/bootstraptoggleclone/SettingsService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.bootstraptoggleclone; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class SettingsService { 7 | private Settings settings = new Settings(false, false); 8 | 9 | public Settings getSettings() { 10 | return settings; 11 | } 12 | 13 | public void setSettings(Settings settings) { 14 | this.settings = settings; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /bootstraptoggleclone/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.web.resources.chain.strategy.content.enabled=true 3 | spring.web.resources.chain.strategy.content.paths=/** 4 | -------------------------------------------------------------------------------- /bootstraptoggleclone/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer utilities { 6 | [x-cloak] { 7 | display: none; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /bootstraptoggleclone/src/test/java/com/wimdeblauwe/examples/bootstraptoggleclone/BootstraptogglecloneApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.bootstraptoggleclone; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class BootstraptogglecloneApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /bootstraptoggleclone/tailwind.config.js: -------------------------------------------------------------------------------- 1 | const defaultTheme = require('tailwindcss/defaultTheme'); 2 | 3 | module.exports = { 4 | content: ['./src/main/resources/templates/**/*.html', 5 | './src/main/resources/templates/**/*.svg'], 6 | theme: { 7 | extend: { 8 | fontFamily: { 9 | sans: ['Inter var', ...defaultTheme.fontFamily.sans], 10 | } 11 | }, 12 | }, 13 | plugins: [ 14 | ], 15 | }; 16 | -------------------------------------------------------------------------------- /datajpatests/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /datajpatests/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/datajpatests/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /datajpatests/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /datajpatests/src/main/java/com/wimdeblauwe/examples/datajpatests/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.datajpatests; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface BookRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /datajpatests/src/main/java/com/wimdeblauwe/examples/datajpatests/DataJpaTestsApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.datajpatests; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DataJpaTestsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DataJpaTestsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /datajpatests/src/main/java/com/wimdeblauwe/examples/datajpatests/SongRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.datajpatests; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface SongRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /datajpatests/src/main/java/com/wimdeblauwe/examples/datajpatests/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.datajpatests; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | public interface UserRepository extends JpaRepository { 6 | } 7 | -------------------------------------------------------------------------------- /datajpatests/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.open-in-view=false -------------------------------------------------------------------------------- /equals-and-hashcode/src/test/java/com/wimdeblauwe/examples/eah/BookTest.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.eah; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.assertj.core.api.Assertions.assertThat; 6 | 7 | class BookTest { 8 | 9 | @Test 10 | void testEquals() { 11 | Book book1 = new Book(1L, "Taming Thymeleaf"); 12 | Book book2 = new Book(1L, "Taming Thymeleaf"); 13 | 14 | assertThat(book1).isEqualTo(book2); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /error-handling-lib-example/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /error-handling-lib-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/error-handling-lib-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /error-handling-lib-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /error-handling-lib-example/HttpRequests.http: -------------------------------------------------------------------------------- 1 | GET http://localhost:8080/api/info-requests/1 2 | Accept: application/json 3 | 4 | ### 5 | -------------------------------------------------------------------------------- /error-handling-lib-example/README.adoc: -------------------------------------------------------------------------------- 1 | = Error handling library for Spring Boot 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2020/07/20/error-handling-library-spring-boot/[Error handling library for Spring Boot] about the https://github.com/wimdeblauwe/error-handling-spring-boot-starter[Error Handling Spring Boot Starter] library. 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.3.1 11 | 12 | == Running 13 | 14 | Run: 15 | [source] 16 | ---- 17 | mvn test 18 | ---- 19 | -------------------------------------------------------------------------------- /error-handling-lib-example/src/main/java/com/wimdeblauwe/examples/errorhandling/ErrorHandlingApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ErrorHandlingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ErrorHandlingApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /error-handling-lib-example/src/main/java/com/wimdeblauwe/examples/errorhandling/inforequest/InfoRequestService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.inforequest; 2 | 3 | import com.wimdeblauwe.examples.errorhandling.inforequest.web.CreateInfoRequestRequestBody; 4 | 5 | import java.util.Optional; 6 | 7 | public interface InfoRequestService { 8 | InfoRequest createInfoRequest(CreateInfoRequestRequestBody requestBody); 9 | 10 | Optional getInfoRequest(Long id); 11 | } 12 | -------------------------------------------------------------------------------- /error-handling-lib-example/src/main/java/com/wimdeblauwe/examples/errorhandling/supportagent/SupportAgent.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.supportagent; 2 | 3 | public class SupportAgent { 4 | private final Long id; 5 | private final String name; 6 | 7 | public SupportAgent(Long id, String name) { 8 | this.id = id; 9 | this.name = name; 10 | } 11 | 12 | public Long getId() { 13 | return id; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /error-handling-lib-example/src/main/java/com/wimdeblauwe/examples/errorhandling/supportagent/SupportAgentNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.supportagent; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class SupportAgentNotFoundException extends RuntimeException { 8 | public SupportAgentNotFoundException(Long id) { 9 | super("There is no known support agent with id " + id); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /error-handling-lib-example/src/main/java/com/wimdeblauwe/examples/errorhandling/supportagent/SupportAgentService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.supportagent; 2 | 3 | import java.util.Optional; 4 | 5 | public interface SupportAgentService { 6 | Optional getSupportAgent(long id); 7 | } 8 | -------------------------------------------------------------------------------- /error-handling-lib-example/src/main/java/com/wimdeblauwe/examples/errorhandling/supportagent/SupportAgentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.supportagent; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import java.util.Optional; 6 | 7 | @Service 8 | public class SupportAgentServiceImpl implements SupportAgentService { 9 | @Override 10 | public Optional getSupportAgent(long id) { 11 | return Optional.empty(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /error-handling-lib-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | error.handling.codes.com.wimdeblauwe.examples.errorhandling.inforequest.InfoRequestNotFoundException=UNKNOWN_INFO_REQUEST 2 | error.handling.exception-logging=message_only 3 | -------------------------------------------------------------------------------- /error-handling-lib-example/src/test/java/com/wimdeblauwe/examples/errorhandling/ErrorHandlingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ErrorHandlingApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /error-handling/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /error-handling/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/error-handling/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /error-handling/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /error-handling/HttpRequests.http: -------------------------------------------------------------------------------- 1 | GET http://localhost:8080/api/info-requests/1 2 | Accept: application/json 3 | 4 | ### 5 | -------------------------------------------------------------------------------- /error-handling/src/main/java/com/wimdeblauwe/examples/errorhandling/ErrorHandlingApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ErrorHandlingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ErrorHandlingApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /error-handling/src/main/java/com/wimdeblauwe/examples/errorhandling/inforequest/InfoRequestNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.inforequest; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class InfoRequestNotFoundException extends RuntimeException { 8 | public InfoRequestNotFoundException(Long id) { 9 | super("There is no known info request with id " + id); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /error-handling/src/main/java/com/wimdeblauwe/examples/errorhandling/inforequest/InfoRequestService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.inforequest; 2 | 3 | import com.wimdeblauwe.examples.errorhandling.inforequest.web.CreateInfoRequestRequestBody; 4 | 5 | import java.util.Optional; 6 | 7 | public interface InfoRequestService { 8 | InfoRequest createInfoRequest(CreateInfoRequestRequestBody requestBody); 9 | 10 | Optional getInfoRequest(Long id); 11 | } 12 | -------------------------------------------------------------------------------- /error-handling/src/main/java/com/wimdeblauwe/examples/errorhandling/supportagent/SupportAgent.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.supportagent; 2 | 3 | public class SupportAgent { 4 | private final Long id; 5 | private final String name; 6 | 7 | public SupportAgent(Long id, String name) { 8 | this.id = id; 9 | this.name = name; 10 | } 11 | 12 | public Long getId() { 13 | return id; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /error-handling/src/main/java/com/wimdeblauwe/examples/errorhandling/supportagent/SupportAgentNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.supportagent; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class SupportAgentNotFoundException extends RuntimeException { 8 | public SupportAgentNotFoundException(Long id) { 9 | super("There is no known support agent with id " + id); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /error-handling/src/main/java/com/wimdeblauwe/examples/errorhandling/supportagent/SupportAgentService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.supportagent; 2 | 3 | import java.util.Optional; 4 | 5 | public interface SupportAgentService { 6 | Optional getSupportAgent(long id); 7 | } 8 | -------------------------------------------------------------------------------- /error-handling/src/main/java/com/wimdeblauwe/examples/errorhandling/supportagent/SupportAgentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling.supportagent; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import java.util.Optional; 6 | 7 | @Service 8 | public class SupportAgentServiceImpl implements SupportAgentService { 9 | @Override 10 | public Optional getSupportAgent(long id) { 11 | return Optional.empty(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /error-handling/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /error-handling/src/test/java/com/wimdeblauwe/examples/errorhandling/ErrorHandlingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.errorhandling; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ErrorHandlingApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/form-handling-thymeleaf/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /form-handling-thymeleaf/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/README.adoc: -------------------------------------------------------------------------------- 1 | = Form handling with Thymeleaf 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2021/05/23/form-handling-with-thymeleaf/[Form handling with Thymeleaf] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.5.0 11 | * Thymeleaf 3.0.12 12 | 13 | == Building 14 | 15 | Run: 16 | [source] 17 | ---- 18 | mvn package 19 | ---- 20 | 21 | == Running 22 | 23 | Run from IntelliJ IDEA or use `mvn spring-boot:run` 24 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/src/main/java/com/wimdeblauwe/examples/formhandlingthymeleaf/FormHandlingThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.formhandlingthymeleaf; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class FormHandlingThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(FormHandlingThymeleafApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/src/main/java/com/wimdeblauwe/examples/formhandlingthymeleaf/user/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.formhandlingthymeleaf.user; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | public interface UserRepository extends JpaRepository { 6 | } 7 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/src/main/java/com/wimdeblauwe/examples/formhandlingthymeleaf/user/UserService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.formhandlingthymeleaf.user; 2 | 3 | import java.util.List; 4 | 5 | public interface UserService { 6 | User createUser(UserCreationParameters parameters); 7 | 8 | List getUsers(); 9 | } 10 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/src/main/resources/templates/users/list.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Users 7 | 8 | 9 |
10 |

Users

11 | 12 |
    13 |
  • 15 |
  • 16 |
17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /form-handling-thymeleaf/src/test/java/com/wimdeblauwe/examples/formhandlingthymeleaf/FormHandlingThymeleafApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.formhandlingthymeleaf; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class FormHandlingThymeleafApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /generate-enum-values-spring-rest-docs/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /generate-enum-values-spring-rest-docs/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/generate-enum-values-spring-rest-docs/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /generate-enum-values-spring-rest-docs/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /generate-enum-values-spring-rest-docs/README.adoc: -------------------------------------------------------------------------------- 1 | = Generate all enum values for Spring REST Docs documentation 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2020/06/08/generate-enum-values-spring-rest-docs/[Generate all enum values for Spring REST Docs documentation] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.3.0 11 | 12 | -------------------------------------------------------------------------------- /generate-enum-values-spring-rest-docs/src/main/asciidoc/Dayinfo API Documentation.adoc: -------------------------------------------------------------------------------- 1 | = Dayinfo API Documentation 2 | 3 | To get information on the current season, use a `GET` on `/api/dayinfo`. 4 | 5 | include::{snippets}/get-dayinfo-example/http-request.adoc[] 6 | 7 | Example response: 8 | 9 | include::{snippets}/get-dayinfo-example/http-response.adoc[] 10 | 11 | Details of the response fields: 12 | 13 | [cols="20,20,60"] 14 | include::{snippets}/get-dayinfo-example/response-fields.adoc[] 15 | -------------------------------------------------------------------------------- /generate-enum-values-spring-rest-docs/src/main/java/com/wimdeblauwe/examples/generateenumvaluesspringrestdocs/Season.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.generateenumvaluesspringrestdocs; 2 | 3 | public enum Season { 4 | SPRING, 5 | SUMMER, 6 | AUTUMN, 7 | WINTER 8 | } 9 | -------------------------------------------------------------------------------- /generate-enum-values-spring-rest-docs/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /generate-enum-values-spring-rest-docs/src/test/java/com/wimdeblauwe/examples/generateenumvaluesspringrestdocs/GenerateEnumValuesSpringRestDocsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.generateenumvaluesspringrestdocs; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GenerateEnumValuesSpringRestDocsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /google-charts-thymeleaf/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /google-charts-thymeleaf/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/google-charts-thymeleaf/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /google-charts-thymeleaf/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /google-charts-thymeleaf/src/main/java/com/wimdeblauwe/examples/googlechartsthymeleaf/GoogleChartsThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.googlechartsthymeleaf; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class GoogleChartsThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(GoogleChartsThymeleafApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /google-charts-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /google-charts-thymeleaf/src/test/java/com/wimdeblauwe/examples/googlechartsthymeleaf/GoogleChartsThymeleafApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.googlechartsthymeleaf; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GoogleChartsThymeleafApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /htmx-global-error-handler/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/htmx-global-error-handler/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /htmx-global-error-handler/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /htmx-global-error-handler/postcss.config.js: -------------------------------------------------------------------------------- 1 | const postcssConfig = { 2 | plugins: [require('autoprefixer'), 3 | require('tailwindcss')], 4 | }; 5 | 6 | // If we are in production mode, then add cssnano 7 | if (process.env.NODE_ENV === 'production') { 8 | postcssConfig.plugins.push( 9 | require('cssnano')({ 10 | // use the safe preset so that it doesn't 11 | // mutate or remove code from our css 12 | preset: 'default', 13 | }) 14 | ); 15 | } 16 | 17 | module.exports = postcssConfig; 18 | -------------------------------------------------------------------------------- /htmx-global-error-handler/src/main/java/com/wimdeblauwe/examples/htmxglobalerrorhandler/HtmxGlobalErrorHandlerExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.htmxglobalerrorhandler; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class HtmxGlobalErrorHandlerExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(HtmxGlobalErrorHandlerExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /htmx-global-error-handler/src/main/resources/application-local.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.web.resources.chain.cache=false 3 | -------------------------------------------------------------------------------- /htmx-global-error-handler/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /htmx-global-error-handler/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /htmx-global-error-handler/src/test/java/com/wimdeblauwe/examples/htmxglobalerrorhandler/HtmxGlobalErrorHandlerExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.htmxglobalerrorhandler; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class HtmxGlobalErrorHandlerExampleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /htmx-global-error-handler/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ['./src/main/resources/templates/**/*.html'], 4 | theme: { 5 | extend: {}, 6 | }, 7 | plugins: [require('daisyui')], 8 | } 9 | 10 | -------------------------------------------------------------------------------- /htmx-iot-demo/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /htmx-iot-demo/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/htmx-iot-demo/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /htmx-iot-demo/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /htmx-iot-demo/src/main/java/com/wimdeblauwe/examples/htmxiotdemo/HtmxIotDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.htmxiotdemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class HtmxIotDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(HtmxIotDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /htmx-iot-demo/src/main/java/com/wimdeblauwe/examples/htmxiotdemo/IotDevice.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.htmxiotdemo; 2 | 3 | public record IotDevice(Long id, String name) { 4 | } 5 | -------------------------------------------------------------------------------- /htmx-iot-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | -------------------------------------------------------------------------------- /htmx-iot-demo/src/main/resources/templates/standard/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | HTMX IoT Demo 7 | 8 | 9 | 10 |

htmx IoT Demo - Standard Thymeleaf

11 |
12 |
13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /htmx-iot-demo/src/main/resources/templates/standard/partials.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 |
6 |

7 |
8 |
Id:
9 |
Temperature:
-
10 |
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /htmx-iot-demo/src/test/java/com/wimdeblauwe/examples/htmxiotdemo/HtmxIotDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.htmxiotdemo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class HtmxIotDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /htmx-sse/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /htmx-sse/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/htmx-sse/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /htmx-sse/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /htmx-sse/src/main/java/com/wimdeblauwe/examples/htmxsse/HtmxSseApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.htmxsse; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class HtmxSseApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(HtmxSseApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /htmx-sse/src/main/java/com/wimdeblauwe/examples/htmxsse/ProgressListener.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.htmxsse; 2 | 3 | public interface ProgressListener { 4 | void onProgress(int value); 5 | 6 | void onCompletion(); 7 | } 8 | -------------------------------------------------------------------------------- /htmx-sse/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /htmx-sse/src/test/java/com/wimdeblauwe/examples/htmxsse/HtmxSseApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.htmxsse; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class HtmxSseApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /junit5-test-order/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /junit5-test-order/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/junit5-test-order/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /junit5-test-order/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /junit5-test-order/src/main/java/com/wimdeblauwe/examples/junit5testorder/Junit5TestOrderApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.junit5testorder; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Junit5TestOrderApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Junit5TestOrderApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /junit5-test-order/src/main/java/com/wimdeblauwe/examples/junit5testorder/user/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.junit5testorder.user; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface UserRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /junit5-test-order/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /junit5-test-order/src/test/java/com/wimdeblauwe/examples/junit5testorder/Junit5TestOrderApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.junit5testorder; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Junit5TestOrderApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /junit5-test-order/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | #junit.jupiter.testclass.order.default=org.junit.jupiter.api.ClassOrderer$Random 2 | junit.jupiter.testclass.order.default=com.wimdeblauwe.examples.junit5testorder.SpringBootTestClassOrderer 3 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/.env.example: -------------------------------------------------------------------------------- 1 | POSTGRES_PASSWORD=ADD_PASSWORD_HERE -------------------------------------------------------------------------------- /laravel-intermediate-task-list/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | .env 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | 23 | ### NetBeans ### 24 | /nbproject/private/ 25 | /nbbuild/ 26 | /dist/ 27 | /nbdist/ 28 | /.nb-gradle/ 29 | build/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/laravel-intermediate-task-list/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /laravel-intermediate-task-list/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | db: 4 | image: 'postgres:12' 5 | ports: 6 | - "5432:5432" 7 | environment: 8 | POSTGRES_DB: "taskdb" 9 | POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} 10 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/java/com/wimdeblauwe/examples/laravelintermediatetasklist/LaravelIntermediateTaskListApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class LaravelIntermediateTaskListApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(LaravelIntermediateTaskListApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/java/com/wimdeblauwe/examples/laravelintermediatetasklist/RootController.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | @Controller 7 | public class RootController { 8 | 9 | @GetMapping("/") 10 | public String welcome() { 11 | return "welcome"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/java/com/wimdeblauwe/examples/laravelintermediatetasklist/task/TaskRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist.task; 2 | 3 | import com.wimdeblauwe.examples.laravelintermediatetasklist.user.User; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | import java.util.List; 7 | 8 | public interface TaskRepository extends CrudRepository { 9 | 10 | List findByUser(User user); 11 | } 12 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/java/com/wimdeblauwe/examples/laravelintermediatetasklist/task/TaskService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist.task; 2 | 3 | import java.util.List; 4 | import java.util.Optional; 5 | 6 | public interface TaskService { 7 | Task createTask(int userId, String name); 8 | 9 | List getTasksByUser(int userId); 10 | 11 | Optional getTask(int taskId); 12 | 13 | void deleteTask(Integer taskId); 14 | } 15 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/java/com/wimdeblauwe/examples/laravelintermediatetasklist/task/web/CreateTaskParameters.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist.task.web; 2 | 3 | import javax.validation.constraints.NotEmpty; 4 | import javax.validation.constraints.Size; 5 | 6 | public class CreateTaskParameters { 7 | @NotEmpty 8 | @Size(max = 255) 9 | private String name; 10 | 11 | public String getName() { 12 | return name; 13 | } 14 | 15 | public void setName(String name) { 16 | this.name = name; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/java/com/wimdeblauwe/examples/laravelintermediatetasklist/user/UserNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist.user; 2 | 3 | public class UserNotFoundException extends RuntimeException { 4 | public UserNotFoundException(String message) { 5 | super(message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/java/com/wimdeblauwe/examples/laravelintermediatetasklist/user/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist.user; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import java.util.Optional; 6 | 7 | public interface UserRepository extends CrudRepository { 8 | Optional findByEmail(String email); 9 | } 10 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/java/com/wimdeblauwe/examples/laravelintermediatetasklist/user/UserService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist.user; 2 | 3 | import java.util.Optional; 4 | 5 | public interface UserService { 6 | User createUser(String name, String email, String password); 7 | 8 | Optional getUser(int userId); 9 | } 10 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:postgresql://localhost/taskdb 2 | spring.datasource.username=postgres 3 | spring.datasource.password=my-secret-pwd 4 | spring.jpa.hibernate.ddl-auto=validate 5 | 6 | spring.mvc.hiddenmethod.filter.enabled=true 7 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/resources/db/migration/V1.0__init.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE task_user 2 | ( 3 | id SERIAL NOT NULL, 4 | name VARCHAR(255) NOT NULL, 5 | email VARCHAR(255) NOT NULL, 6 | password VARCHAR(255) NOT NULL, 7 | PRIMARY KEY (id) 8 | ); 9 | 10 | CREATE TABLE task 11 | ( 12 | id SERIAL NOT NULL, 13 | user_id SERIAL NOT NULL, 14 | name VARCHAR(255) NOT NULL, 15 | PRIMARY KEY (id) 16 | ); 17 | 18 | ALTER TABLE task 19 | ADD CONSTRAINT FK_task_to_user FOREIGN KEY (user_id) REFERENCES task_user; 20 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/resources/templates/fragments/messages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

There was a problem creating the task:

5 |
    6 |
  • 7 |
8 |
9 | 10 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/main/resources/templates/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 |

Welcome

9 |
10 | Your Application's Landing Page. 11 |
12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /laravel-intermediate-task-list/src/test/java/com/wimdeblauwe/examples/laravelintermediatetasklist/LaravelIntermediateTaskListApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.laravelintermediatetasklist; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LaravelIntermediateTaskListApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /live-reload-dev-tools/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /live-reload-dev-tools/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/live-reload-dev-tools/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /live-reload-dev-tools/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /live-reload-dev-tools/src/main/java/com/wimdeblauwe/examples/livereloaddevtools/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.livereloaddevtools; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @RequestMapping("/") 8 | @Controller 9 | public class IndexController { 10 | @GetMapping 11 | public String index() { 12 | return "index"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /live-reload-dev-tools/src/main/java/com/wimdeblauwe/examples/livereloaddevtools/LiveReloadDevToolsApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.livereloaddevtools; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class LiveReloadDevToolsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(LiveReloadDevToolsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /live-reload-dev-tools/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /live-reload-dev-tools/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: black; 3 | } 4 | -------------------------------------------------------------------------------- /live-reload-dev-tools/src/main/resources/static/js/test.js: -------------------------------------------------------------------------------- 1 | function test() { 2 | console.log('test'); 3 | } 4 | -------------------------------------------------------------------------------- /live-reload-dev-tools/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Live Reload Dev Tools 7 | 8 | 9 | 10 |

Hello Live Reload!

11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /live-reload-dev-tools/src/test/java/com/wimdeblauwe/examples/livereloaddevtools/LiveReloadDevToolsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.livereloaddevtools; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LiveReloadDevToolsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/live-reload-npm-scripts-tailwindcss/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/copy-files.js: -------------------------------------------------------------------------------- 1 | var ncp = require('ncp').ncp; 2 | var fs = require('fs'); 3 | 4 | ncp.limit = 16; 5 | 6 | ncp('./src/main/resources', 'target/classes', { 7 | filter: (source) => { 8 | if (fs.lstatSync(source).isDirectory()) { 9 | return true; 10 | } else { 11 | return source.match(process.argv[2]) != null; 12 | } 13 | } 14 | }, function (err) { 15 | if (err) { 16 | return console.error(err); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/postcss.config.js: -------------------------------------------------------------------------------- 1 | const postcssConfig = { 2 | plugins: [ 3 | require('autoprefixer'), 4 | require('tailwindcss') 5 | ], 6 | }; 7 | 8 | // If we are in production mode, then add cssnano 9 | if (process.env.NODE_ENV === 'production') { 10 | postcssConfig.plugins.push( 11 | require('cssnano')({ 12 | // use the safe preset so that it doesn't 13 | // mutate or remove code from our css 14 | preset: 'default', 15 | }) 16 | ); 17 | } 18 | 19 | module.exports = postcssConfig; 20 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/src/main/java/com/wimdeblauwe/examples/livereloadnpmscriptstailwindcss/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.livereloadnpmscriptstailwindcss; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @RequestMapping("/") 8 | @Controller 9 | public class IndexController { 10 | @GetMapping 11 | public String index() { 12 | return "index"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/src/main/resources/application-local.properties.example: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer base { 6 | h1 { 7 | @apply text-2xl; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/src/main/resources/static/js/test.js: -------------------------------------------------------------------------------- 1 | function test() { 2 | console.log('test'); 3 | } 4 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Live Reload NPM Scripts 7 | 8 | 9 | 10 |

Hello Live Reload!

11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/src/test/java/com/wimdeblauwe/examples/livereloadnpmscriptstailwindcss/LiveReloadNpmScriptsTailwindCssApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.livereloadnpmscriptstailwindcss; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LiveReloadNpmScriptsTailwindCssApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /live-reload-npm-scripts-tailwindcss/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ['./src/main/resources/templates/**/*.html'], 4 | theme: { 5 | extend: {}, 6 | }, 7 | plugins: [], 8 | } 9 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/live-reload-npm-scripts/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /live-reload-npm-scripts/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/copy-files.js: -------------------------------------------------------------------------------- 1 | var ncp = require('ncp').ncp; 2 | var fs = require('fs'); 3 | 4 | ncp.limit = 16; 5 | 6 | ncp('./src/main/resources', 'target/classes', { 7 | filter: (source) => { 8 | if (fs.lstatSync(source).isDirectory()) { 9 | return true; 10 | } else { 11 | return source.match(process.argv[2]) != null; 12 | } 13 | } 14 | }, function (err) { 15 | if (err) { 16 | return console.error(err); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/postcss.config.js: -------------------------------------------------------------------------------- 1 | const postcssConfig = { 2 | plugins: [require('autoprefixer')], 3 | }; 4 | 5 | // If we are in production mode, then add cssnano 6 | if (process.env.NODE_ENV === 'production') { 7 | postcssConfig.plugins.push( 8 | require('cssnano')({ 9 | // use the safe preset so that it doesn't 10 | // mutate or remove code from our css 11 | preset: 'default', 12 | }) 13 | ); 14 | } 15 | 16 | module.exports = postcssConfig; 17 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/src/main/java/com/wimdeblauwe/examples/livereloadnpmscripts/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.livereloadnpmscripts; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @RequestMapping("/") 8 | @Controller 9 | public class IndexController { 10 | @GetMapping 11 | public String index() { 12 | return "index"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/src/main/java/com/wimdeblauwe/examples/livereloadnpmscripts/LiveReloadNpmScriptsApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.livereloadnpmscripts; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class LiveReloadNpmScriptsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(LiveReloadNpmScriptsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/src/main/resources/application-local.properties.example: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: black; 3 | } 4 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/src/main/resources/static/js/test.js: -------------------------------------------------------------------------------- 1 | function test() { 2 | console.log('test'); 3 | } 4 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Live Reload NPM Scripts 7 | 8 | 9 | 10 |

Hello Live Reload!

11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /live-reload-npm-scripts/src/test/java/com/wimdeblauwe/examples/livereloadnpmscripts/LiveReloadNpmScriptsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.livereloadnpmscripts; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LiveReloadNpmScriptsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /primary-key-object/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/primary-key-object/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /primary-key-object/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /primary-key-object/README.adoc: -------------------------------------------------------------------------------- 1 | = Using primary key objects with Spring Data and Hibernate 2 | 3 | == General 4 | 5 | Source code for the blog post https://wimdeblauwe.wordpress.com/2019/10/27/using-primary-key-objects-with-spring-data-and-hibernate/[Using primary key objects with Spring Data and Hibernate] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.2.0 11 | * Hibernate 5.4.6 12 | 13 | == Building 14 | 15 | Run: 16 | [source] 17 | ---- 18 | mvn package 19 | ---- 20 | 21 | == Running 22 | 23 | Run from IntelliJ IDEA or use `mvn spring-boot:run` 24 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/PrimaryKeyObjectApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class PrimaryKeyObjectApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(PrimaryKeyObjectApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/infrastructure/jpa/Entity.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject.infrastructure.jpa; 2 | 3 | public interface Entity { 4 | T getId(); 5 | } 6 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/order/OrderId.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject.order; 2 | 3 | import com.wimdeblauwe.examples.primarykeyobject.infrastructure.jpa.AbstractLongEntityId; 4 | 5 | public class OrderId extends AbstractLongEntityId { 6 | public OrderId(Long value) { 7 | super(value); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/order/OrderIdIdentifierGenerator.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject.order; 2 | 3 | import com.wimdeblauwe.examples.primarykeyobject.infrastructure.jpa.AbstractLongEntityIdIdentifierGenerator; 4 | 5 | public class OrderIdIdentifierGenerator extends AbstractLongEntityIdIdentifierGenerator { 6 | 7 | @Override 8 | protected OrderId createEntityId(long seqValue) { 9 | return new OrderId(seqValue); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/order/OrderRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject.order; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface OrderRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/order/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject.order; 2 | 3 | import com.wimdeblauwe.examples.primarykeyobject.user.UserId; 4 | 5 | public interface OrderService { 6 | Order getOrder(OrderId orderId, UserId userId); 7 | } 8 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/user/UserId.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject.user; 2 | 3 | import com.wimdeblauwe.examples.primarykeyobject.infrastructure.jpa.AbstractLongEntityId; 4 | 5 | public class UserId extends AbstractLongEntityId { 6 | 7 | public UserId(Long value) { 8 | super(value); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/user/UserIdIdentifierGenerator.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject.user; 2 | 3 | import com.wimdeblauwe.examples.primarykeyobject.infrastructure.jpa.AbstractLongEntityIdIdentifierGenerator; 4 | 5 | public class UserIdIdentifierGenerator extends AbstractLongEntityIdIdentifierGenerator { 6 | 7 | @Override 8 | protected UserId createEntityId(long seqValue) { 9 | return new UserId(seqValue); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /primary-key-object/src/main/java/com/wimdeblauwe/examples/primarykeyobject/user/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject.user; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface UserRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /primary-key-object/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.show-sql=true 2 | -------------------------------------------------------------------------------- /primary-key-object/src/test/java/com/wimdeblauwe/examples/primarykeyobject/PrimaryKeyObjectApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.primarykeyobject; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class PrimaryKeyObjectApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /reactive-error-handling/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /reactive-error-handling/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/reactive-error-handling/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /reactive-error-handling/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /reactive-error-handling/src/main/java/com/wimdeblauwe/examples/reactiveerrorhandling/ExceptionWithBadRequestStatus.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.reactiveerrorhandling; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.BAD_REQUEST) 7 | public class ExceptionWithBadRequestStatus extends RuntimeException { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /reactive-error-handling/src/main/java/com/wimdeblauwe/examples/reactiveerrorhandling/ReactiveErrorHandlingApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.reactiveerrorhandling; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ReactiveErrorHandlingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ReactiveErrorHandlingApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /reactive-error-handling/src/main/java/com/wimdeblauwe/examples/reactiveerrorhandling/User.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.reactiveerrorhandling; 2 | 3 | public record User(String name) { 4 | } 5 | -------------------------------------------------------------------------------- /reactive-error-handling/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | error.handling.codes.com.wimdeblauwe.examples.reactiveerrorhandling.ExceptionWithBadRequestStatus=BAD_REQUEST 2 | -------------------------------------------------------------------------------- /reactive-error-handling/src/test/http/HttpTest.http: -------------------------------------------------------------------------------- 1 | GET localhost:8080/users/1 2 | 3 | ### 4 | GET localhost:8080/bad-request 5 | 6 | ### 7 | GET localhost:8080/matrix-variable 8 | 9 | ### 10 | GET localhost:8080/path-variable 11 | 12 | ### 13 | GET localhost:8080/request-cookie 14 | 15 | ### 16 | GET localhost:8080/request-header 17 | 18 | ### 19 | GET localhost:8080/missing-servlet-request-parameter 20 | 21 | ### 22 | 23 | POST localhost:8080 24 | Content-Type: application/json 25 | 26 | { 27 | "name": "", 28 | "email": "invalid" 29 | } 30 | 31 | -------------------------------------------------------------------------------- /reactive-error-handling/src/test/java/com/wimdeblauwe/examples/reactiveerrorhandling/ReactiveErrorHandlingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.reactiveerrorhandling; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ReactiveErrorHandlingApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /redirect-attributes/.gitattributes: -------------------------------------------------------------------------------- 1 | /mvnw text eol=lf 2 | *.cmd text eol=crlf 3 | -------------------------------------------------------------------------------- /redirect-attributes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "redirect-attributes-demo", 3 | "type": "module", 4 | "devDependencies": { 5 | "@tailwindcss/forms": "^0.5.9", 6 | "@wim.deblauwe/vite-plugin-spring-boot": "^0.4.2", 7 | "autoprefixer": "^10.4.20", 8 | "postcss": "^8.4.49", 9 | "tailwindcss": "^3.4.15", 10 | "vite": "^5.4.11" 11 | }, 12 | "scripts": { 13 | "dev": "vite", 14 | "dev-open": "vite --open http://localhost:8080", 15 | "build": "vite build" 16 | }, 17 | "private": true 18 | } 19 | -------------------------------------------------------------------------------- /redirect-attributes/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /redirect-attributes/src/main/java/com/wimdeblauwe/examples/redirect_attributes/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.redirect_attributes; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | @Controller 9 | @RequestMapping("/") 10 | public class HomeController { 11 | @GetMapping 12 | public String index(Model model) { 13 | return "index"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /redirect-attributes/src/main/java/com/wimdeblauwe/examples/redirect_attributes/RedirectAttributesDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.redirect_attributes; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RedirectAttributesDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RedirectAttributesDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /redirect-attributes/src/main/java/com/wimdeblauwe/examples/redirect_attributes/product/Product.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.redirect_attributes.product; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.UUID; 5 | 6 | public record Product(UUID id, String name, BigDecimal price) { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /redirect-attributes/src/main/resources/application-local.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.web.resources.chain.cache=false 3 | 4 | vite.mode=dev 5 | -------------------------------------------------------------------------------- /redirect-attributes/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=Redirect Attributes Demo 2 | vite.mode=build 3 | -------------------------------------------------------------------------------- /redirect-attributes/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | .btn { 6 | @apply rounded-md bg-indigo-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 7 | } -------------------------------------------------------------------------------- /redirect-attributes/src/test/java/com/wimdeblauwe/examples/redirect_attributes/RedirectAttributesDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.redirect_attributes; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RedirectAttributesDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /redirect-attributes/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: ['./src/main/resources/templates/**/*.html'], 4 | theme: { 5 | extend: {}, 6 | }, 7 | plugins: [require('@tailwindcss/forms')], 8 | } 9 | 10 | -------------------------------------------------------------------------------- /request-parameters-validation/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /request-parameters-validation/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/request-parameters-validation/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /request-parameters-validation/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /request-parameters-validation/src/main/java/com/wimdeblauwe/examples/requestparametersvalidation/RequestParametersValidationApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.requestparametersvalidation; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RequestParametersValidationApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RequestParametersValidationApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /request-parameters-validation/src/main/java/com/wimdeblauwe/examples/requestparametersvalidation/Task.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.requestparametersvalidation; 2 | 3 | public record Task() { 4 | } 5 | -------------------------------------------------------------------------------- /request-parameters-validation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | error.handling.codes.FromMoreRecentThenTo=FROM_MORE_RECENT_THEN_TO 2 | -------------------------------------------------------------------------------- /request-parameters-validation/src/test/java/com/wimdeblauwe/examples/requestparametersvalidation/RequestParametersValidationApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.requestparametersvalidation; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RequestParametersValidationApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/shoelace-thymeleaf-alpine/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/postcss.config.js: -------------------------------------------------------------------------------- 1 | const postcssConfig = { 2 | plugins: [require('autoprefixer'), 3 | require('tailwindcss')], 4 | }; 5 | 6 | // If we are in production mode, then add cssnano 7 | if (process.env.NODE_ENV === 'production') { 8 | postcssConfig.plugins.push( 9 | require('cssnano')({ 10 | // use the safe preset so that it doesn't 11 | // mutate or remove code from our css 12 | preset: 'default', 13 | }) 14 | ); 15 | } 16 | 17 | module.exports = postcssConfig; 18 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/src/main/java/com/deblauwe/examples/shoelacethymeleafalpine/ShoelaceThymeleafAlpineDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.deblauwe.examples.shoelacethymeleafalpine; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ShoelaceThymeleafAlpineDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ShoelaceThymeleafAlpineDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/src/main/resources/application-local.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.web.resources.chain.cache=false 3 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.messages.basename=i18n/messages 2 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/src/main/resources/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | application.title=Shoelace - Thymeleaf - Alpine Demo 2 | item.added.title=Item Added 3 | item.added.message=Your item {0} has been added to your cart. 4 | item.added-near-shipping.message=Your item {0} has been added to your cart. Spend another {1} to avoid shipping costs! 5 | item.black.tee=Black Tee 6 | application.error=There was a problem communicating with the server. 7 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/src/main/resources/i18n/messages_nl.properties: -------------------------------------------------------------------------------- 1 | application.title=Shoelace - Thymeleaf - Alpine Demo (NL) 2 | item.added.title=Stuk toegevoegd 3 | item.added.message=Je stuk {0} is toegevoegd aan je winkelkar. 4 | item.added-near-shipping.message=Je stuk {0} is toegevoegd aan je winkelkar. Koop nog voor {1} om geen verzendkosten te hebben! 5 | item.black.tee=T-shirt Zwart 6 | application.error=Er was een communicatie probleem met de server. 7 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/src/test/java/com/deblauwe/examples/shoelacethymeleaf/ShoelaceThymeleafAlpineDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.deblauwe.examples.shoelacethymeleaf; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ShoelaceThymeleafAlpineDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shoelace-thymeleaf-alpine/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ['./src/main/resources/templates/**/*.html'], 4 | theme: { 5 | extend: {}, 6 | }, 7 | plugins: [], 8 | } 9 | -------------------------------------------------------------------------------- /shoelace-thymeleaf/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /shoelace-thymeleaf/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/shoelace-thymeleaf/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /shoelace-thymeleaf/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /shoelace-thymeleaf/postcss.config.js: -------------------------------------------------------------------------------- 1 | const postcssConfig = { 2 | plugins: [require('autoprefixer'), 3 | require('tailwindcss')], 4 | }; 5 | 6 | // If we are in production mode, then add cssnano 7 | if (process.env.NODE_ENV === 'production') { 8 | postcssConfig.plugins.push( 9 | require('cssnano')({ 10 | // use the safe preset so that it doesn't 11 | // mutate or remove code from our css 12 | preset: 'default', 13 | }) 14 | ); 15 | } 16 | 17 | module.exports = postcssConfig; 18 | -------------------------------------------------------------------------------- /shoelace-thymeleaf/src/main/java/com/deblauwe/examples/shoelacethymeleaf/ShoelaceThymeleafDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.deblauwe.examples.shoelacethymeleaf; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ShoelaceThymeleafDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ShoelaceThymeleafDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shoelace-thymeleaf/src/main/resources/application-local.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.web.resources.chain.cache=false 3 | -------------------------------------------------------------------------------- /shoelace-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /shoelace-thymeleaf/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /shoelace-thymeleaf/src/test/java/com/deblauwe/examples/shoelacethymeleaf/ShoelaceThymeleafDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.deblauwe.examples.shoelacethymeleaf; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ShoelaceThymeleafDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /shoelace-thymeleaf/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ['./src/main/resources/templates/**/*.html'], 4 | theme: { 5 | extend: {}, 6 | }, 7 | plugins: [], 8 | } 9 | -------------------------------------------------------------------------------- /slidev-example/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | *.local 5 | .vite-inspect 6 | .remote-assets 7 | components.d.ts 8 | -------------------------------------------------------------------------------- /slidev-example/.npmrc: -------------------------------------------------------------------------------- 1 | # for pnpm 2 | shamefully-hoist=true 3 | auto-install-peers=true 4 | -------------------------------------------------------------------------------- /slidev-example/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to [Slidev](https://github.com/slidevjs/slidev)! 2 | 3 | To start the slide show: 4 | 5 | - `npm install` 6 | - `npm run dev` 7 | - visit 8 | 9 | Edit the [slides.md](./slides.md) to see the changes. 10 | 11 | Learn more about Slidev at the [documentation](https://sli.dev/). 12 | -------------------------------------------------------------------------------- /slidev-example/global-bottom.vue: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /slidev-example/images/tools.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/slidev-example/images/tools.jpg -------------------------------------------------------------------------------- /slidev-example/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "dist" 3 | command = "npm run build" 4 | 5 | [build.environment] 6 | NODE_VERSION = "20" 7 | 8 | [[redirects]] 9 | from = "/.well-known/*" 10 | to = "/.well-known/:splat" 11 | status = 200 12 | 13 | [[redirects]] 14 | from = "/*" 15 | to = "/index.html" 16 | status = 200 17 | -------------------------------------------------------------------------------- /slidev-example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "slidev-example", 3 | "type": "module", 4 | "private": true, 5 | "scripts": { 6 | "build": "slidev build", 7 | "dev": "slidev --open", 8 | "export": "slidev export" 9 | }, 10 | "dependencies": { 11 | "@slidev/cli": "^0.50.0-beta.5", 12 | "@slidev/theme-default": "latest", 13 | "@slidev/theme-seriph": "latest", 14 | "vue": "^3.5.12" 15 | }, 16 | "devDependencies": { 17 | "@iconify-json/devicon": "^1.2.4", 18 | "@iconify-json/solar": "^1.2.1", 19 | "@unocss/preset-icons": "^0.63.6" 20 | } 21 | } -------------------------------------------------------------------------------- /slidev-example/pages/imported-slides.md: -------------------------------------------------------------------------------- 1 | # Imported Slides 2 | 3 | You can split your slides.md into multiple files and organize them as you want using the `src` attribute. 4 | 5 | #### `slides.md` 6 | 7 | ```markdown 8 | # Page 1 9 | 10 | Page 2 from main entry. 11 | 12 | --- 13 | 14 | ## src: ./subpage.md 15 | ``` 16 | 17 |
18 | 19 | #### `subpage.md` 20 | 21 | ```markdown 22 | # Page 2 23 | 24 | Page 2 from another file. 25 | ``` 26 | 27 | [Learn more](https://sli.dev/guide/syntax.html#importing-slides) 28 | -------------------------------------------------------------------------------- /slidev-example/snippets/external.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | // #region snippet 4 | // Inside ./snippets/external.ts 5 | export function emptyArray(length: number) { 6 | return Array.from({ length }) 7 | } 8 | // #endregion snippet 9 | 10 | export function sayHello() { 11 | console.log('Hello from snippets/external.ts') 12 | } 13 | -------------------------------------------------------------------------------- /slidev-example/style.css: -------------------------------------------------------------------------------- 1 | .tweet-container { 2 | display: flex; 3 | justify-content: center; 4 | margin: 20px 0; 5 | } 6 | -------------------------------------------------------------------------------- /slidev-example/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewrites": [ 3 | { "source": "/(.*)", "destination": "/index.html" } 4 | ], 5 | "buildCommand": "npm run build", 6 | "outputDirectory": "dist" 7 | } 8 | -------------------------------------------------------------------------------- /spring-boot-test-slices/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /spring-boot-test-slices/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/spring-boot-test-slices/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-boot-test-slices/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /spring-boot-test-slices/README.adoc: -------------------------------------------------------------------------------- 1 | = Spring Boot test slices with custom annotations 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2020/04/17/spring-boot-test-slices-with-custom-annotations/[Spring Boot test slices with custom annotations] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.2.6 11 | 12 | == Building 13 | 14 | Run: 15 | [source] 16 | ---- 17 | mvn package 18 | ---- 19 | 20 | == Running 21 | 22 | Run from IntelliJ IDEA or use `mvn spring-boot:run` 23 | -------------------------------------------------------------------------------- /spring-boot-test-slices/src/main/java/com/wimdeblauwe/examples/springboottestslices/SpringBootTestSlicesApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.springboottestslices; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootTestSlicesApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootTestSlicesApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-test-slices/src/main/java/com/wimdeblauwe/examples/springboottestslices/album/AlbumRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.springboottestslices.album; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | public interface AlbumRepository extends CrudRepository { 6 | } 7 | -------------------------------------------------------------------------------- /spring-boot-test-slices/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-boot-test-slices/src/main/resources/db/migration/V1.0__init.sql: -------------------------------------------------------------------------------- 1 | CREATE SEQUENCE hibernate_sequence; 2 | 3 | CREATE TABLE album 4 | ( 5 | id bigint not null, 6 | name text not null, 7 | artist text not null, 8 | primary key (id) 9 | ); 10 | -------------------------------------------------------------------------------- /spring-boot-test-slices/src/test/java/com/wimdeblauwe/examples/springboottestslices/SpringBootTestSlicesApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.springboottestslices; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootTestSlicesApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-test-slices/src/test/resources/application-data-jpa-test.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:tc:postgresql:12:///albumdb?TC_TMPFS=/testtmpfs:rw 2 | spring.datasource.driver-class-name=org.testcontainers.jdbc.ContainerDatabaseDriver 3 | spring.datasource.username=user 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect 6 | spring.jpa.hibernate.ddl-auto=validate -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/README.adoc: -------------------------------------------------------------------------------- 1 | = Example usage of testcontainers-cypress 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2020-02-11-testcontainers-cypress-release-0.4.0/[Testcontainers-cypress release 0.4.0] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.2.4 11 | * Thymeleaf 3.0.11 12 | * Testcontainers-Cypress 0.4.0 13 | 14 | == Building 15 | 16 | Run: 17 | [source] 18 | ---- 19 | mvn package 20 | ---- 21 | 22 | == Running 23 | 24 | Run from IntelliJ IDEA or use `mvn spring-boot:run` 25 | 26 | 27 | -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/main/java/com/wimdeblauwe/examples/testcontainerscypressexample/TestcontainersCypressExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainerscypressexample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TestcontainersCypressExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TestcontainersCypressExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/main/java/com/wimdeblauwe/examples/testcontainerscypressexample/todo/Todo.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainerscypressexample.todo; 2 | 3 | public class Todo { 4 | private String description; 5 | 6 | public Todo(String description) { 7 | this.description = description; 8 | } 9 | 10 | public String getDescription() { 11 | return description; 12 | } 13 | 14 | public void setDescription(String description) { 15 | this.description = description; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/test/e2e/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:8080", 3 | "reporter": "cypress-multi-reporters", 4 | "reporterOptions": { 5 | "configFile": "reporter-config.json" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/test/e2e/cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/test/e2e/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testcontainers-cypress-example", 3 | "version": "0.0.1-SNAPSHOT", 4 | "description": "", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "devDependencies": { 9 | "cypress": "^4.0.1", 10 | "cypress-multi-reporters": "^1.2.3", 11 | "mocha": "^7.0.1", 12 | "mochawesome": "^4.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/test/e2e/reporter-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "reporterEnabled": "spec, mochawesome", 3 | "mochawesomeReporterOptions": { 4 | "reportDir": "cypress/reports/mochawesome", 5 | "overwrite": false, 6 | "html": false, 7 | "json": true 8 | } 9 | } -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/test/java/com/wimdeblauwe/examples/testcontainerscypressexample/TestcontainersCypressExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainerscypressexample; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TestcontainersCypressExampleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /testcontainers-cypress-0.4.0-example/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %date{YYYY-MM-dd HH:mm:ss} %level [%thread] %logger{0} - %msg%n%ex 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /testcontainers-cypress-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/testcontainers-cypress-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /testcontainers-cypress-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /testcontainers-cypress-example/README.adoc: -------------------------------------------------------------------------------- 1 | = Example usage of testcontainers-cypress 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2020-02-01-example-usage-of-testcontainers-cypress/[Example usage of testcontainers-cypress] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.2.4 11 | * Thymeleaf 3.0.11 12 | * Testcontainers-Cypress 0.2.0 13 | 14 | == Building 15 | 16 | Run: 17 | [source] 18 | ---- 19 | mvn package 20 | ---- 21 | 22 | == Running 23 | 24 | Run from IntelliJ IDEA or use `mvn spring-boot:run` 25 | 26 | 27 | -------------------------------------------------------------------------------- /testcontainers-cypress-example/src/main/java/com/wimdeblauwe/examples/testcontainerscypressexample/TestcontainersCypressExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainerscypressexample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TestcontainersCypressExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TestcontainersCypressExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /testcontainers-cypress-example/src/main/java/com/wimdeblauwe/examples/testcontainerscypressexample/todo/Todo.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainerscypressexample.todo; 2 | 3 | public class Todo { 4 | private String description; 5 | 6 | public Todo(String description) { 7 | this.description = description; 8 | } 9 | 10 | public String getDescription() { 11 | return description; 12 | } 13 | 14 | public void setDescription(String description) { 15 | this.description = description; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /testcontainers-cypress-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testcontainers-cypress-example/src/test/e2e/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:8080", 3 | "reporter": "cypress-multi-reporters", 4 | "reporterOptions": { 5 | "configFile": "reporter-config.json" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /testcontainers-cypress-example/src/test/e2e/cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } -------------------------------------------------------------------------------- /testcontainers-cypress-example/src/test/e2e/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testcontainers-cypress-example", 3 | "version": "0.0.1-SNAPSHOT", 4 | "description": "", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "devDependencies": { 9 | "cypress": "^4.5.0", 10 | "cypress-multi-reporters": "^1.2.4", 11 | "mocha": "^7.1.2", 12 | "mochawesome": "^5.0.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /testcontainers-cypress-example/src/test/e2e/reporter-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "reporterEnabled": "spec, mochawesome", 3 | "mochawesomeReporterOptions": { 4 | "reportDir": "cypress/reports/mochawesome", 5 | "overwrite": false, 6 | "html": false, 7 | "json": true 8 | } 9 | } -------------------------------------------------------------------------------- /testcontainers-cypress-example/src/test/java/com/wimdeblauwe/examples/testcontainerscypressexample/TestcontainersCypressExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainerscypressexample; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TestcontainersCypressExampleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-docker-compose/.gitattributes: -------------------------------------------------------------------------------- 1 | /mvnw text eol=lf 2 | *.cmd text eol=crlf 3 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-docker-compose/src/main/java/com/wimdeblauwe/examples/testcontainers_docker_compose/BicycleRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainers_docker_compose; 2 | 3 | import org.springframework.data.repository.ListCrudRepository; 4 | 5 | import java.util.UUID; 6 | 7 | public interface BicycleRepository extends ListCrudRepository { 8 | } 9 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-docker-compose/src/main/java/com/wimdeblauwe/examples/testcontainers_docker_compose/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainers_docker_compose; 2 | 3 | import org.springframework.data.repository.ListCrudRepository; 4 | 5 | import java.util.UUID; 6 | 7 | public interface UserRepository extends ListCrudRepository { 8 | } 9 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-docker-compose/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=testcontainers-docker-compose 2 | spring.kafka.producer.transaction-id-prefix=my-app-${random.uuid} 3 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-docker-compose/src/main/resources/db/migration/V1.0.0__init.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE bicycle 2 | ( 3 | id UUID PRIMARY KEY, 4 | name TEXT 5 | ); 6 | 7 | CREATE TABLE "user" 8 | ( 9 | id UUID PRIMARY KEY, 10 | name TEXT 11 | ); -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-docker-compose/src/test/java/com/wimdeblauwe/examples/testcontainers_docker_compose/TestcontainersDockerComposeApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainers_docker_compose; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | @MyAppSpringBootTest 6 | class TestcontainersDockerComposeApplicationTests { 7 | 8 | @Test 9 | void contextLoads() { 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-multiple-configurations/.gitattributes: -------------------------------------------------------------------------------- 1 | /mvnw text eol=lf 2 | *.cmd text eol=crlf 3 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-multiple-configurations/src/main/java/com/wimdeblauwe/examples/testcontainers_multiple_configurations/BicycleRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainers_multiple_configurations; 2 | 3 | import org.springframework.data.repository.ListCrudRepository; 4 | 5 | import java.util.UUID; 6 | 7 | public interface BicycleRepository extends ListCrudRepository { 8 | } 9 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-multiple-configurations/src/main/java/com/wimdeblauwe/examples/testcontainers_multiple_configurations/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.testcontainers_multiple_configurations; 2 | 3 | import org.springframework.data.repository.ListCrudRepository; 4 | 5 | import java.util.UUID; 6 | 7 | public interface UserRepository extends ListCrudRepository { 8 | } 9 | -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-multiple-configurations/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=testcontainers-multiple-initializers 2 | spring.kafka.producer.transaction-id-prefix=my-app-${random.uuid} -------------------------------------------------------------------------------- /testcontainers-multiple-services/testcontainers-multiple-configurations/src/main/resources/db/migration/V1.0.0__init.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE bicycle 2 | ( 3 | id UUID PRIMARY KEY, 4 | name TEXT 5 | ); 6 | 7 | CREATE TABLE "user" 8 | ( 9 | id UUID PRIMARY KEY, 10 | name TEXT 11 | ); -------------------------------------------------------------------------------- /thymeleaf-google-login/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/thymeleaf-google-login/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /thymeleaf-google-login/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /thymeleaf-google-login/src/main/java/com/deblauwe/examples/thymeleafgooglelogin/ThymeleafGoogleLoginApplication.java: -------------------------------------------------------------------------------- 1 | package com.deblauwe.examples.thymeleafgooglelogin; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafGoogleLoginApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafGoogleLoginApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-google-login/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.security.oauth2.client.registration.google.client-id= 2 | spring.security.oauth2.client.registration.google.client-secret= 3 | -------------------------------------------------------------------------------- /thymeleaf-google-login/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Google login demo 7 | 8 | 9 |
Hello
10 | 11 | 12 | -------------------------------------------------------------------------------- /thymeleaf-google-login/src/test/java/com/deblauwe/examples/thymeleafgooglelogin/ThymeleafGoogleLoginApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.deblauwe.examples.thymeleafgooglelogin; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ThymeleafGoogleLoginApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/thymeleaf-htmx-auth-error-handling/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/src/main/java/com/wimdeblauwe/examples/thymeleafhtmxautherrorhandling/ChuckNorrisJoke.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafhtmxautherrorhandling; 2 | 3 | public record ChuckNorrisJoke(String value) { 4 | } 5 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/src/main/java/com/wimdeblauwe/examples/thymeleafhtmxautherrorhandling/ChuckNorrisJokesApiClient.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafhtmxautherrorhandling; 2 | 3 | import retrofit2.Call; 4 | import retrofit2.http.GET; 5 | 6 | public interface ChuckNorrisJokesApiClient { 7 | 8 | @GET("/jokes/random") 9 | Call randomJoke(); 10 | } 11 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/src/main/java/com/wimdeblauwe/examples/thymeleafhtmxautherrorhandling/ThymeleafHtmxAuthErrorHandlingApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafhtmxautherrorhandling; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafHtmxAuthErrorHandlingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafHtmxAuthErrorHandlingApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | chuck-norris-api-client.base-url=https://api.chucknorris.io 2 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | .joke-parent { 2 | margin-top: 1.5rem; 3 | } 4 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/src/main/resources/templates/fragments.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 |
7 | 8 | 9 | -------------------------------------------------------------------------------- /thymeleaf-htmx-auth-error-handling/src/test/java/com/wimdeblauwe/examples/thymeleafhtmxautherrorhandling/ThymeleafHtmxAuthErrorHandlingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafhtmxautherrorhandling; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ThymeleafHtmxAuthErrorHandlingApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-iteration-fragments/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /thymeleaf-iteration-fragments/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/thymeleaf-iteration-fragments/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /thymeleaf-iteration-fragments/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /thymeleaf-iteration-fragments/src/main/java/com/wimdeblauwe/examples/thymeleafiterationfragments/ThymeleafIterationFragmentsApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafiterationfragments; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafIterationFragmentsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafIterationFragmentsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-iteration-fragments/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /thymeleaf-iteration-fragments/src/test/java/com/wimdeblauwe/examples/thymeleafiterationfragments/ThymeleafIterationFragmentsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafiterationfragments; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ThymeleafIterationFragmentsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "thymeleaf-live-reload", 3 | "scripts": { 4 | "watch": "gulp watch", 5 | "build": "gulp build", 6 | "build-prod": "gulp build --env production" 7 | }, 8 | "devDependencies": { 9 | "@babel/core": "^7.6.0", 10 | "@babel/preset-env": "^7.6.0", 11 | "browser-sync": "^2.26.7", 12 | "gulp": "^4.0.2", 13 | "gulp-babel": "^8.0.0", 14 | "gulp-environments": "^0.1.2", 15 | "gulp-terser": "^1.2.0", 16 | "gulp-uglifycss": "^1.1.0", 17 | "gulp-watch": "^5.0.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/src/main/java/com/wimdeblauwe/examples/thymeleaflivereload/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleaflivereload; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @Controller 8 | @RequestMapping("/") 9 | public class HomeController { 10 | 11 | @GetMapping 12 | public String home() { 13 | return "home"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/src/main/java/com/wimdeblauwe/examples/thymeleaflivereload/ThymeleafLiveReloadApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleaflivereload; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafLiveReloadApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafLiveReloadApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/src/main/resources/application-live.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: floralwhite; 3 | } 4 | h1 { 5 | color: black; 6 | } 7 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/src/main/resources/static/js/application.js: -------------------------------------------------------------------------------- 1 | const tagline = document.getElementById('tagline'); 2 | tagline.innerHTML = 'Added with JavaScript'; 3 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 |

Wim Deblauwe

9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /thymeleaf-live-reload/src/test/java/com/wimdeblauwe/examples/thymeleaflivereload/ThymeleafLiveReloadApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleaflivereload; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class ThymeleafLiveReloadApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /thymeleaf-react/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /thymeleaf-react/src/main/java/com/wimdeblauwe/examples/thymeleaf_react/ThymeleafReactDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleaf_react; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafReactDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafReactDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-react/src/main/resources/application-local.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.web.resources.chain.cache=false 3 | 4 | vite.mode=dev 5 | -------------------------------------------------------------------------------- /thymeleaf-react/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=Thymeleaf React Demo 2 | vite.mode=build 3 | -------------------------------------------------------------------------------- /thymeleaf-react/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | ok=OK 2 | cancel=Cancel` -------------------------------------------------------------------------------- /thymeleaf-react/src/main/resources/messages_nl.properties: -------------------------------------------------------------------------------- 1 | ok=OK 2 | cancel=Annuleren -------------------------------------------------------------------------------- /thymeleaf-react/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /thymeleaf-react/src/main/resources/static/react/FlowbiteExample.tsx: -------------------------------------------------------------------------------- 1 | import { Button } from "flowbite-react"; 2 | import {createRoot} from 'react-dom/client' 3 | 4 | let element = document.getElementById('flowbite-example-wrapper'); 5 | createRoot(element!).render( 6 | 7 | ) 8 | export default function FlowbiteExample() { 9 | return ; 10 | } -------------------------------------------------------------------------------- /thymeleaf-react/src/main/resources/static/react/ListExample.tsx: -------------------------------------------------------------------------------- 1 | import {createRoot} from 'react-dom/client' 2 | 3 | let element = document.getElementById('list-example-wrapper'); 4 | createRoot(element!).render( 5 | 6 | ) 7 | 8 | export default function ListExample() { 9 | return ( 10 |
    11 | {["Wim", "Thomas", "Oliver"] 12 | .map(name =>
  • Hello {name} from React
  • )} 13 |
14 | ) 15 | } -------------------------------------------------------------------------------- /thymeleaf-react/src/main/resources/templates/timeline.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 |
8 |
9 |
10 | 11 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /thymeleaf-react/src/test/java/com/wimdeblauwe/examples/thymeleaf_react/ThymeleafReactDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleaf_react; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ThymeleafReactDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-react/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | const flowbite = require("flowbite-react/tailwind"); 3 | 4 | export default { 5 | content: ['./src/main/resources/templates/**/*.html', 6 | './src/main/resources/static/react/**', 7 | flowbite.content()], 8 | theme: { 9 | extend: {}, 10 | }, 11 | plugins: [flowbite.plugin()], 12 | } 13 | 14 | -------------------------------------------------------------------------------- /thymeleaf-react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { "path": "./tsconfig.app.json" }, 5 | { "path": "./tsconfig.node.json" } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /thymeleaf-web-components/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /thymeleaf-web-components/src/main/java/com/wimdeblauwe/examples/thymeleaf_web_components/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleaf_web_components; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | @Controller 9 | @RequestMapping("/") 10 | public class HomeController { 11 | @GetMapping 12 | public String index(Model model) { 13 | return "index"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /thymeleaf-web-components/src/main/java/com/wimdeblauwe/examples/thymeleaf_web_components/ThymeleafWebComponentsApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleaf_web_components; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafWebComponentsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafWebComponentsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-web-components/src/main/resources/application-local.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.web.resources.chain.cache=false 3 | 4 | vite.mode=dev 5 | -------------------------------------------------------------------------------- /thymeleaf-web-components/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=Thymeleaf Web Components 2 | vite.mode=build 3 | -------------------------------------------------------------------------------- /thymeleaf-web-components/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /thymeleaf-web-components/src/main/resources/static/wc/scss.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.scss?inline" { 2 | import { CSSResultGroup } from "lit"; 3 | const styles: CSSResultGroup; 4 | export default styles; 5 | } 6 | -------------------------------------------------------------------------------- /thymeleaf-web-components/src/test/java/com/wimdeblauwe/examples/thymeleaf_web_components/ThymeleafWebComponentsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleaf_web_components; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ThymeleafWebComponentsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-web-components/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: ['./src/main/resources/templates/**/*.html'], 4 | theme: { 5 | extend: {}, 6 | }, 7 | plugins: [], 8 | } 9 | 10 | -------------------------------------------------------------------------------- /thymeleaf-with-records/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /thymeleaf-with-records/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/thymeleaf-with-records/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /thymeleaf-with-records/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /thymeleaf-with-records/src/main/java/com/wimdeblauwe/examples/thymeleafwithrecords/Person.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafwithrecords; 2 | 3 | public record Person(String givenName, String familyName) { 4 | } 5 | -------------------------------------------------------------------------------- /thymeleaf-with-records/src/main/java/com/wimdeblauwe/examples/thymeleafwithrecords/TestController.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafwithrecords; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | 7 | @Controller 8 | public class TestController { 9 | 10 | @GetMapping 11 | public String index(Model model) { 12 | model.addAttribute("person", new Person("Wout", "Van Aert")); 13 | return "index"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /thymeleaf-with-records/src/main/java/com/wimdeblauwe/examples/thymeleafwithrecords/ThymeleafWithRecordsApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafwithrecords; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafWithRecordsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafWithRecordsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-with-records/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /thymeleaf-with-records/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Thymeleaf with Records 6 | 7 | 8 |
9 |

Property access

10 |
11 |
12 |

Method calls

13 |
14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /thymeleaf-with-records/src/test/java/com/wimdeblauwe/examples/thymeleafwithrecords/ThymeleafWithRecordsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafwithrecords; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ThymeleafWithRecordsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/thymeleaf-with-tailwind-css/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/src/main/java/com/wimdeblauwe/examples/thymeleafwithtailwindcss/ThymeleafWithTailwindCssApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafwithtailwindcss; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafWithTailwindCssApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafWithTailwindCssApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/src/main/java/com/wimdeblauwe/examples/thymeleafwithtailwindcss/Todo.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafwithtailwindcss; 2 | 3 | public class Todo { 4 | private final String description; 5 | 6 | public Todo(String description) { 7 | this.description = description; 8 | } 9 | 10 | public String getDescription() { 11 | return description; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/src/main/resources/application-live.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/src/main/resources/static/css/application.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | 3 | @tailwind components; 4 | 5 | @tailwind utilities; -------------------------------------------------------------------------------- /thymeleaf-with-tailwind-css/src/test/java/com/wimdeblauwe/examples/thymeleafwithtailwindcss/ThymeleafWithTailwindCssApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.thymeleafwithtailwindcss; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ThymeleafWithTailwindCssApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /todomvc-htmx-boost/src/main/java/com/wimdeblauwe/examples/todomvchtmx/TodomvcThymeleafHtmxBoostApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TodomvcThymeleafHtmxBoostApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TodomvcThymeleafHtmxBoostApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /todomvc-htmx-boost/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/TodoItemNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class TodoItemNotFoundException extends RuntimeException { 8 | public TodoItemNotFoundException(Long id) { 9 | super(String.format("TodoItem with id %s not found", id)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /todomvc-htmx-boost/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/TodoItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import java.util.List; 6 | 7 | public interface TodoItemRepository extends JpaRepository { 8 | int countAllByCompleted(boolean completed); 9 | 10 | List findAllByCompleted(boolean completed); 11 | } 12 | -------------------------------------------------------------------------------- /todomvc-htmx-boost/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/web/TodoItemFormData.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem.web; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | public class TodoItemFormData { 6 | @NotBlank 7 | private String title; 8 | 9 | public String getTitle() { 10 | return title; 11 | } 12 | 13 | public void setTitle(String title) { 14 | this.title = title; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /todomvc-htmx-boost/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.hiddenmethod.filter.enabled=true 2 | -------------------------------------------------------------------------------- /todomvc-htmx-boost/src/test/java/com/wimdeblauwe/examples/todomvchtmx/TodomvcThymeleafHtmxBoostApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TodomvcThymeleafHtmxBoostApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /todomvc-htmx-oob/src/main/java/com/wimdeblauwe/examples/todomvchtmx/TodomvcThymeleafHtmxOobApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TodomvcThymeleafHtmxOobApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TodomvcThymeleafHtmxOobApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /todomvc-htmx-oob/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/TodoItemNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class TodoItemNotFoundException extends RuntimeException { 8 | public TodoItemNotFoundException(Long id) { 9 | super(String.format("TodoItem with id %s not found", id)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /todomvc-htmx-oob/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/TodoItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import java.util.List; 6 | 7 | public interface TodoItemRepository extends JpaRepository { 8 | int countAllByCompleted(boolean completed); 9 | 10 | List findAllByCompleted(boolean completed); 11 | } 12 | -------------------------------------------------------------------------------- /todomvc-htmx-oob/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/web/TodoItemFormData.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem.web; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | public class TodoItemFormData { 6 | @NotBlank 7 | private String title; 8 | 9 | public String getTitle() { 10 | return title; 11 | } 12 | 13 | public void setTitle(String title) { 14 | this.title = title; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /todomvc-htmx-oob/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.hiddenmethod.filter.enabled=true 2 | -------------------------------------------------------------------------------- /todomvc-htmx-oob/src/test/java/com/wimdeblauwe/examples/todomvchtmx/TodomvcThymeleafHtmxApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TodomvcThymeleafHtmxApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /todomvc-htmx/src/main/java/com/wimdeblauwe/examples/todomvchtmx/TodomvcThymeleafHtmxApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TodomvcThymeleafHtmxApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TodomvcThymeleafHtmxApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /todomvc-htmx/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/TodoItemNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class TodoItemNotFoundException extends RuntimeException { 8 | public TodoItemNotFoundException(Long id) { 9 | super(String.format("TodoItem with id %s not found", id)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /todomvc-htmx/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/TodoItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import java.util.List; 6 | 7 | public interface TodoItemRepository extends JpaRepository { 8 | int countAllByCompleted(boolean completed); 9 | 10 | List findAllByCompleted(boolean completed); 11 | } 12 | -------------------------------------------------------------------------------- /todomvc-htmx/src/main/java/com/wimdeblauwe/examples/todomvchtmx/todoitem/web/TodoItemFormData.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx.todoitem.web; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | public class TodoItemFormData { 6 | @NotBlank 7 | private String title; 8 | 9 | public String getTitle() { 10 | return title; 11 | } 12 | 13 | public void setTitle(String title) { 14 | this.title = title; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /todomvc-htmx/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.hiddenmethod.filter.enabled=true 2 | -------------------------------------------------------------------------------- /todomvc-htmx/src/test/java/com/wimdeblauwe/examples/todomvchtmx/TodomvcThymeleafHtmxApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvchtmx; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TodomvcThymeleafHtmxApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /todomvc-thymeleaf/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /todomvc-thymeleaf/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/todomvc-thymeleaf/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /todomvc-thymeleaf/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /todomvc-thymeleaf/src/main/java/com/wimdeblauwe/examples/todomvcthymeleaf/TodomvcThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvcthymeleaf; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TodomvcThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TodomvcThymeleafApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /todomvc-thymeleaf/src/main/java/com/wimdeblauwe/examples/todomvcthymeleaf/todoitem/TodoItemNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvcthymeleaf.todoitem; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class TodoItemNotFoundException extends RuntimeException { 8 | public TodoItemNotFoundException(Long id) { 9 | super(String.format("TodoItem with id %s not found", id)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /todomvc-thymeleaf/src/main/java/com/wimdeblauwe/examples/todomvcthymeleaf/todoitem/TodoItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvcthymeleaf.todoitem; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import java.util.List; 6 | 7 | public interface TodoItemRepository extends JpaRepository { 8 | int countAllByCompleted(boolean completed); 9 | 10 | List findAllByCompleted(boolean completed); 11 | } 12 | -------------------------------------------------------------------------------- /todomvc-thymeleaf/src/main/java/com/wimdeblauwe/examples/todomvcthymeleaf/todoitem/web/TodoItemFormData.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvcthymeleaf.todoitem.web; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | public class TodoItemFormData { 6 | @NotBlank 7 | private String title; 8 | 9 | public String getTitle() { 10 | return title; 11 | } 12 | 13 | public void setTitle(String title) { 14 | this.title = title; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /todomvc-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.hiddenmethod.filter.enabled=true 2 | -------------------------------------------------------------------------------- /todomvc-thymeleaf/src/test/java/com/wimdeblauwe/examples/todomvcthymeleaf/TodomvcThymeleafApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.todomvcthymeleaf; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TodomvcThymeleafApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | postgres: 3 | image: 'postgres:latest' 4 | environment: 5 | - 'POSTGRES_DB=mydatabase' 6 | - 'POSTGRES_PASSWORD=secret' 7 | - 'POSTGRES_USER=myuser' 8 | ports: 9 | - '5432:5432' 10 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration_json/infrastructure/mail/MailGateway.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration_json.infrastructure.mail; 2 | 3 | import org.springframework.integration.annotation.Gateway; 4 | import org.springframework.integration.annotation.MessagingGateway; 5 | 6 | @MessagingGateway 7 | public interface MailGateway { 8 | 9 | @Gateway(requestChannel = "mailInput") 10 | void sendMail(MailMessage mailMessage); 11 | } 12 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration_json/infrastructure/mail/MailMessage.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration_json.infrastructure.mail; 2 | 3 | import java.io.Serial; 4 | import java.io.Serializable; 5 | 6 | public record MailMessage(String subject, String body, String to) implements Serializable { 7 | 8 | @Serial 9 | private static final long serialVersionUID = 1L; 10 | } 11 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration_json/infrastructure/mail/MailSender.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration_json.infrastructure.mail; 2 | 3 | public interface MailSender { 4 | 5 | void sendMail(MailMessage mailMessage); 6 | } 7 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration_json/order/repository/OrderRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration_json.order.repository; 2 | 3 | import com.wimdeblauwe.examples.transactional_outbox_spring_integration_json.order.Order; 4 | import org.springframework.data.repository.ListCrudRepository; 5 | 6 | public interface OrderRepository extends ListCrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=transactional-outbox-spring-integration-json 2 | spring.datasource.url=jdbc:postgresql://localhost:5432/mydatabase 3 | spring.datasource.username=myuser 4 | spring.datasource.password=secret 5 | #logging.level.org.springframework.integration=DEBUG -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/src/main/resources/db/migration/V1.0.1__orders.sql: -------------------------------------------------------------------------------- 1 | -- CREATE SEQUENCE order_seq; 2 | 3 | CREATE TABLE "order" 4 | ( 5 | id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY NOT NULL, 6 | amount DECIMAL, 7 | customer_email VARCHAR(255) 8 | ); -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-json/src/test/http/requests.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/orders 2 | Content-Type: application/json 3 | 4 | { 5 | "amount": "100.0", 6 | "email": "test@example.com" 7 | } -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-oracle/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | oracle: 3 | image: 'gvenzl/oracle-free:23-slim-faststart' 4 | environment: 5 | ORACLE_RANDOM_PASSWORD: true 6 | ORACLE_DATABASE: testDB 7 | APP_USER: oracle_db_user 8 | APP_USER_PASSWORD: oracle_db_pwd 9 | ports: 10 | - "1521:1521" -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-oracle/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/infrastructure/mail/MailGateway.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration.infrastructure.mail; 2 | 3 | import org.springframework.integration.annotation.Gateway; 4 | import org.springframework.integration.annotation.MessagingGateway; 5 | 6 | @MessagingGateway 7 | public interface MailGateway { 8 | 9 | @Gateway(requestChannel = "mailInput") 10 | void sendMail(MailMessage mailMessage); 11 | } 12 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-oracle/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/infrastructure/mail/MailMessage.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration.infrastructure.mail; 2 | 3 | import java.io.Serial; 4 | import java.io.Serializable; 5 | 6 | public record MailMessage(String subject, String body, String to) implements Serializable { 7 | 8 | @Serial 9 | private static final long serialVersionUID = 1L; 10 | } 11 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-oracle/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/infrastructure/mail/MailSender.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration.infrastructure.mail; 2 | 3 | public interface MailSender { 4 | 5 | void sendMail(MailMessage mailMessage); 6 | } 7 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-oracle/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/order/repository/OrderRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration.order.repository; 2 | 3 | import com.wimdeblauwe.examples.transactional_outbox_spring_integration.order.Order; 4 | import org.springframework.data.repository.ListCrudRepository; 5 | 6 | public interface OrderRepository extends ListCrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration-oracle/src/test/http/requests.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/orders 2 | Content-Type: application/json 3 | 4 | { 5 | "amount": "100.0", 6 | "email": "test@example.com" 7 | } -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | postgres: 3 | image: 'postgres:latest' 4 | environment: 5 | - 'POSTGRES_DB=mydatabase' 6 | - 'POSTGRES_PASSWORD=secret' 7 | - 'POSTGRES_USER=myuser' 8 | ports: 9 | - '5432:5432' 10 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/infrastructure/mail/MailGateway.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration.infrastructure.mail; 2 | 3 | import org.springframework.integration.annotation.Gateway; 4 | import org.springframework.integration.annotation.MessagingGateway; 5 | 6 | @MessagingGateway 7 | public interface MailGateway { 8 | 9 | @Gateway(requestChannel = "mailInput") 10 | void sendMail(MailMessage mailMessage); 11 | } 12 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/infrastructure/mail/MailMessage.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration.infrastructure.mail; 2 | 3 | import java.io.Serial; 4 | import java.io.Serializable; 5 | 6 | public record MailMessage(String subject, String body, String to) implements Serializable { 7 | 8 | @Serial 9 | private static final long serialVersionUID = 1L; 10 | } 11 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/infrastructure/mail/MailSender.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration.infrastructure.mail; 2 | 3 | public interface MailSender { 4 | 5 | void sendMail(MailMessage mailMessage); 6 | } 7 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/order/repository/OrderRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration.order.repository; 2 | 3 | import com.wimdeblauwe.examples.transactional_outbox_spring_integration.order.Order; 4 | import org.springframework.data.repository.ListCrudRepository; 5 | 6 | public interface OrderRepository extends ListCrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=transactional-outbox-spring-integration 2 | spring.datasource.url=jdbc:postgresql://localhost:5432/mydatabase 3 | spring.datasource.username=myuser 4 | spring.datasource.password=secret 5 | #logging.level.org.springframework.integration=DEBUG -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/src/main/resources/db/migration/V1.0.1__orders.sql: -------------------------------------------------------------------------------- 1 | -- CREATE SEQUENCE order_seq; 2 | 3 | CREATE TABLE "order" 4 | ( 5 | id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY NOT NULL, 6 | amount DECIMAL, 7 | customer_email VARCHAR(255) 8 | ); -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/src/test/http/requests.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/orders 2 | Content-Type: application/json 3 | 4 | { 5 | "amount": "100.0", 6 | "email": "test@example.com" 7 | } -------------------------------------------------------------------------------- /transactional-outbox-spring-integration/src/test/java/com/wimdeblauwe/examples/transactional_outbox_spring_integration/TestTransactionalOutboxSpringIntegrationApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_integration; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | 5 | public class TestTransactionalOutboxSpringIntegrationApplication { 6 | 7 | public static void main(String[] args) { 8 | SpringApplication.from(TransactionalOutboxSpringIntegrationApplication::main).with(TestcontainersConfiguration.class).run(args); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | postgres: 3 | image: 'postgres:latest' 4 | environment: 5 | - 'POSTGRES_DB=mydatabase' 6 | - 'POSTGRES_PASSWORD=secret' 7 | - 'POSTGRES_USER=myuser' 8 | ports: 9 | - '5432:5432' 10 | -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_modulith/infrastructure/mail/MailMessage.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_modulith.infrastructure.mail; 2 | 3 | import java.io.Serial; 4 | import java.io.Serializable; 5 | 6 | public record MailMessage(String subject, String body, String to) implements Serializable { 7 | 8 | @Serial 9 | private static final long serialVersionUID = 1L; 10 | } 11 | -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_modulith/infrastructure/mail/MailSender.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_modulith.infrastructure.mail; 2 | 3 | public interface MailSender { 4 | 5 | void sendMail(MailMessage mailMessage); 6 | } 7 | -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_modulith/order/OrderCompleted.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_modulith.order; 2 | 3 | public record OrderCompleted(Long orderId) { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/main/java/com/wimdeblauwe/examples/transactional_outbox_spring_modulith/order/repository/OrderRepository.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_modulith.order.repository; 2 | 3 | import com.wimdeblauwe.examples.transactional_outbox_spring_modulith.order.Order; 4 | import org.springframework.data.repository.ListCrudRepository; 5 | 6 | public interface OrderRepository extends ListCrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=transactional-outbox-spring-modulith 2 | spring.datasource.url=jdbc:postgresql://localhost:5432/mydatabase 3 | spring.datasource.username=myuser 4 | spring.datasource.password=secret 5 | 6 | #spring.modulith.republish-outstanding-events-on-restart=true -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/main/resources/db/migration/V1.0.0__spring-modulith-event-publication.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS event_publication 2 | ( 3 | id UUID NOT NULL, 4 | listener_id TEXT NOT NULL, 5 | event_type TEXT NOT NULL, 6 | serialized_event TEXT NOT NULL, 7 | publication_date TIMESTAMP WITH TIME ZONE NOT NULL, 8 | completion_date TIMESTAMP WITH TIME ZONE, 9 | PRIMARY KEY (id) 10 | ) -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/main/resources/db/migration/V1.0.1__orders.sql: -------------------------------------------------------------------------------- 1 | -- CREATE SEQUENCE order_seq; 2 | 3 | CREATE TABLE "order" 4 | ( 5 | id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY NOT NULL, 6 | amount DECIMAL, 7 | customer_email VARCHAR(255) 8 | ); -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/test/http/requests.http: -------------------------------------------------------------------------------- 1 | POST http://localhost:8080/orders 2 | Content-Type: application/json 3 | 4 | { 5 | "amount": "100.0", 6 | "email": "test@example.com" 7 | } -------------------------------------------------------------------------------- /transactional-outbox-spring-modulith/src/test/java/com/wimdeblauwe/examples/transactional_outbox_spring_modulith/TransactionalOutboxSpringModulithApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.transactional_outbox_spring_modulith; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class TransactionalOutboxSpringModulithApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /value-objects-with-rest-api-uuid/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /value-objects-with-rest-api-uuid/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/value-objects-with-rest-api-uuid/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /value-objects-with-rest-api-uuid/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /value-objects-with-rest-api-uuid/README.adoc: -------------------------------------------------------------------------------- 1 | = UUID based Value Objects with Spring Boot REST API 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2020/03/03/uuid-based-value-objects-with-spring-boot-rest-api/[Value Objects with Spring Boot REST API] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.2.4 11 | 12 | == Building 13 | 14 | Run: 15 | [source] 16 | ---- 17 | mvn package 18 | ---- 19 | 20 | == Running 21 | 22 | Run from IntelliJ IDEA or use `mvn spring-boot:run` 23 | -------------------------------------------------------------------------------- /value-objects-with-rest-api-uuid/src/main/java/com/wimdeblauwe/examples/valueobjectswithrestapiuuid/ValueObjectsWithRestApiUuidApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.valueobjectswithrestapiuuid; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ValueObjectsWithRestApiUuidApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ValueObjectsWithRestApiUuidApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /value-objects-with-rest-api-uuid/src/main/java/com/wimdeblauwe/examples/valueobjectswithrestapiuuid/user/web/UserInfo.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.valueobjectswithrestapiuuid.user.web; 2 | 3 | public class UserInfo { 4 | } 5 | -------------------------------------------------------------------------------- /value-objects-with-rest-api-uuid/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /value-objects-with-rest-api-uuid/src/test/java/com/wimdeblauwe/examples/valueobjectswithrestapiuuid/ValueObjectsWithRestApiUuidApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.valueobjectswithrestapiuuid; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ValueObjectsWithRestApiUuidApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /value-objects-with-rest-api/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /value-objects-with-rest-api/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wimdeblauwe/blog-example-code/afe9642a1265d6c0bd782a23c77b0f3e529fc0af/value-objects-with-rest-api/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /value-objects-with-rest-api/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /value-objects-with-rest-api/README.adoc: -------------------------------------------------------------------------------- 1 | = Value Objects with Spring Boot REST API 2 | 3 | == General 4 | 5 | Source code for the blog post https://www.wimdeblauwe.com/blog/2020/02/26/value-objects-with-spring-boot-rest-api/[Value Objects with Spring Boot REST API] 6 | 7 | Technologies used: 8 | 9 | * Java 11 10 | * Spring Boot 2.2.4 11 | 12 | == Building 13 | 14 | Run: 15 | [source] 16 | ---- 17 | mvn package 18 | ---- 19 | 20 | == Running 21 | 22 | Run from IntelliJ IDEA or use `mvn spring-boot:run` 23 | -------------------------------------------------------------------------------- /value-objects-with-rest-api/src/main/java/com/wimdeblauwe/examples/valueobjectswithrestapi/ValueObjectsWithRestApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.valueobjectswithrestapi; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ValueObjectsWithRestApiApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ValueObjectsWithRestApiApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /value-objects-with-rest-api/src/main/java/com/wimdeblauwe/examples/valueobjectswithrestapi/user/StringToUserIdConverter.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.valueobjectswithrestapi.user; 2 | 3 | import org.springframework.core.convert.converter.Converter; 4 | import org.springframework.lang.NonNull; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class StringToUserIdConverter implements Converter { 9 | @Override 10 | public UserId convert(@NonNull String s) { 11 | return new UserId(Long.parseLong(s)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /value-objects-with-rest-api/src/main/java/com/wimdeblauwe/examples/valueobjectswithrestapi/user/web/UserInfo.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.valueobjectswithrestapi.user.web; 2 | 3 | public class UserInfo { 4 | } 5 | -------------------------------------------------------------------------------- /value-objects-with-rest-api/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /value-objects-with-rest-api/src/test/java/com/wimdeblauwe/examples/valueobjectswithrestapi/ValueObjectsWithRestApiApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wimdeblauwe.examples.valueobjectswithrestapi; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ValueObjectsWithRestApiApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | --------------------------------------------------------------------------------