├── README.md ├── login-registration-springboot-hibernate-jsp-auth ├── .classpath ├── .project ├── .settings │ ├── .jsdtscope │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── org.eclipse.wst.jsdt.ui.superType.container │ ├── org.eclipse.wst.jsdt.ui.superType.name │ ├── org.eclipse.wst.validation.prefs │ └── org.springframework.ide.eclipse.prefs ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── guides │ │ └── springboot │ │ └── loginregistrationspringbootauthjsp │ │ ├── Application.java │ │ ├── config │ │ └── WebSecurityConfig.java │ │ ├── model │ │ ├── Role.java │ │ └── User.java │ │ ├── repository │ │ ├── RoleRepository.java │ │ └── UserRepository.java │ │ ├── service │ │ ├── UserDetailsServiceImpl.java │ │ ├── UserService.java │ │ └── UserServiceImpl.java │ │ ├── validator │ │ └── UserValidator.java │ │ └── web │ │ └── UserController.java │ ├── resources │ ├── application.properties │ └── validation.properties │ └── webapp │ ├── WEB-INF │ ├── jsp │ │ ├── login.jsp │ │ ├── registration.jsp │ │ └── welcome.jsp │ └── web.xml │ ├── index.jsp │ └── resources │ ├── css │ ├── bootstrap.min.css │ └── common.css │ └── js │ └── bootstrap.min.js ├── spring-aop-advice-examples ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2jpacrudexample │ │ │ ├── Application.java │ │ │ ├── SpringRestClient.java │ │ │ ├── aspect │ │ │ └── LoggingAspect.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── exception │ │ │ ├── ErrorDetails.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ ├── repository │ │ │ └── EmployeeRepository.java │ │ │ └── service │ │ │ └── EmployeeService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2jpacrudexample │ └── ApplicationTests.java ├── spring-boot-crud-rest ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── api-documents ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── companyname │ │ │ └── springbootcrudrest │ │ │ ├── SpringBootCrudRestApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── ErrorDetails.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── companyname │ └── projectname │ └── springbootcrudrest │ └── SpringBootCrudRestApplicationTests.java ├── spring-propertysource-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── myapp.log ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springpropertysourceexample │ │ │ ├── Application.java │ │ │ ├── DataSourceConfig.java │ │ │ └── ProperySourceDemo.java │ └── resources │ │ ├── application.properties │ │ └── config.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springpropertysourceexample │ └── SpringPropertysourceExampleApplicationTests.java ├── springboot-angular8-helloworld-example └── Springboot-helloworld-application │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── springboot │ │ │ └── Springboothelloworldapplication │ │ │ ├── Application.java │ │ │ ├── Greeting.java │ │ │ └── GreetingController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── javaguides │ └── springboot │ └── Springboothelloworldapplication │ └── ApplicationTests.java ├── springboot-async-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot │ │ │ └── springbootasyncexample │ │ │ ├── SpringbootAsyncApplication.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── service │ │ │ └── GitHubLookupService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot │ └── springbootasyncexample │ └── SpringbootAsyncApplicationTests.java ├── springboot-crud-hibernate-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── springboot │ │ │ ├── SpringbootCrudHibernateExampleApplication.java │ │ │ ├── controller │ │ │ └── ProductController.java │ │ │ ├── exception │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Product.java │ │ │ ├── repository │ │ │ └── ProductRepository.java │ │ │ └── service │ │ │ ├── ProductService.java │ │ │ └── ProductServiceImpl.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── javaguides │ └── springboot │ └── SpringbootCrudHibernateExampleApplicationTests.java ├── springboot-crud-rest-api-validation ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot │ │ │ └── springbootcrudrestapivalidation │ │ │ ├── SpringbootCrudRestApiValidationApplication.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── exception │ │ │ ├── ErrorDetails.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot │ └── springbootcrudrestapivalidation │ └── SpringbootCrudRestApiValidationApplicationTests.java ├── springboot-hibernate-composite-key-demo ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── springboot │ │ │ ├── SpringbootHibernateCompositeKeyDemoApplication.java │ │ │ ├── entity │ │ │ ├── Employee.java │ │ │ └── EmployeeIdentity.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── javaguides │ └── springboot │ └── SpringbootHibernateCompositeKeyDemoApplicationTests.java ├── springboot-hibernate-many-to-many-mapping ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── springboot │ │ │ ├── SpringbootHibernateManyToManyMappingApplication.java │ │ │ ├── entity │ │ │ ├── Post.java │ │ │ └── Tag.java │ │ │ └── repository │ │ │ ├── PostRepository.java │ │ │ └── TagRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── javaguides │ └── springboot │ └── SpringbootHibernateManyToManyMappingApplicationTests.java ├── springboot-hibernate-one-many-mapping ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── springboot │ │ │ ├── SpringbootHibernateOneManyMappingApplication.java │ │ │ ├── entity │ │ │ ├── Comment.java │ │ │ └── Post.java │ │ │ └── repository │ │ │ ├── CommentRepository.java │ │ │ └── PostRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── javaguides │ └── springboot │ └── SpringbootHibernateOneManyMappingApplicationTests.java ├── springboot-hibernate-one-one-mapping ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── springboot │ │ │ ├── SpringbootHibernateOneOneMappingApplication.java │ │ │ ├── entity │ │ │ ├── Gender.java │ │ │ ├── User.java │ │ │ └── UserProfile.java │ │ │ └── repository │ │ │ ├── UserProfileRepository.java │ │ │ └── UserRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── javaguides │ └── springboot │ └── SpringbootHibernateOneOneMappingApplicationTests.java ├── springboot-jpa-one-to-one-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── guides │ │ └── springboot │ │ └── jpa │ │ ├── Application.java │ │ ├── controller │ │ ├── InstructorController.java │ │ └── ResourceNotFoundException.java │ │ ├── model │ │ ├── Instructor.java │ │ └── InstructorDetail.java │ │ └── repository │ │ └── InstructorRepository.java │ └── resources │ └── application.properties ├── springboot-jsp-hello-world-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── springboot │ │ │ ├── SpringbootJspHelloWorldExampleApplication.java │ │ │ └── controller │ │ │ └── HelloController.java │ ├── resources │ │ └── application.properties │ └── webapp │ │ └── WEB-INF │ │ └── jsp │ │ └── hello.jsp │ └── test │ └── java │ └── net │ └── javaguides │ └── springboot │ └── SpringbootJspHelloWorldExampleApplicationTests.java ├── springboot-mongodb-crud ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── springboot │ │ │ └── javaguides │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── ProductController.java │ │ │ ├── exception │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Product.java │ │ │ ├── repository │ │ │ └── ProductRepository.java │ │ │ └── service │ │ │ ├── ProductService.java │ │ │ └── ProductServiceImpl.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── add-student.html │ │ ├── index.html │ │ └── update-student.html │ └── test │ └── java │ └── net │ └── springboot │ └── javaguides │ └── ApplicationTests.java ├── springboot-mssql-jpa-hibernate-crud-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── javaguides │ │ └── mssql │ │ ├── Application.java │ │ ├── controller │ │ └── EmployeeController.java │ │ ├── exception │ │ ├── ErrorDetails.java │ │ ├── GlobalExceptionHandler.java │ │ └── ResourceNotFoundException.java │ │ ├── model │ │ └── Employee.java │ │ └── repository │ │ └── EmployeeRepository.java │ └── resources │ └── application.properties ├── springboot-multiple-datasources ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ └── org.eclipse.wst.common.project.facet.core.xml ├── pom.xml ├── springboot-multiple-datasources.iml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot │ │ │ └── springbootmultipledatasources │ │ │ ├── SpringbootMultipleDatasourcesApplication.java │ │ │ ├── config │ │ │ ├── OrdersDataSourceConfig.java │ │ │ ├── SecurityDataSourceConfig.java │ │ │ └── WebMvcConfig.java │ │ │ ├── controllers │ │ │ └── HomeController.java │ │ │ ├── orders │ │ │ ├── entities │ │ │ │ ├── Order.java │ │ │ │ └── OrderItem.java │ │ │ └── repositories │ │ │ │ └── OrderRepository.java │ │ │ ├── security │ │ │ ├── entities │ │ │ │ ├── Address.java │ │ │ │ └── User.java │ │ │ └── repositories │ │ │ │ └── UserRepository.java │ │ │ └── services │ │ │ └── UserOrdersService.java │ └── resources │ │ ├── application-prod.properties │ │ ├── application.properties │ │ ├── orders-data.sql │ │ ├── security-data.sql │ │ └── templates │ │ └── users.html │ └── test │ └── java │ └── net │ └── guides │ └── springboot │ └── springbootmultipledatasources │ └── SpringbootMultipleDatasourcesApplicationTests.java ├── springboot-postgresql-jpa-hibernate-crud-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── postgresql │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── exception │ │ │ ├── ErrorDetails.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2jpacrudexample │ ├── ApplicationTests.java │ └── EmployeeControllerIntegrationTest.java ├── springboot-stomp-websocket ├── .classpath ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ └── org.eclipse.wst.common.project.facet.core.xml ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── mvnw ├── mvnw.cmd ├── pom.xml ├── springboot-stomp-websocket.iml └── src │ └── main │ ├── java │ └── net │ │ └── javaguides │ │ └── springboot │ │ └── websocket │ │ ├── Application.java │ │ ├── config │ │ └── WebSocketConfig.java │ │ ├── controller │ │ └── GreetingController.java │ │ └── model │ │ ├── Greeting.java │ │ └── HelloMessage.java │ └── resources │ └── static │ ├── app.js │ ├── index.html │ └── main.css ├── springboot-testing-examples ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboottestingexamples │ │ │ ├── SpringbootTestingExamplesApplication.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboottestingexamples │ └── EmployeeRepositoryTests.java ├── springboot-thymeleaf-hello-world-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── javaguides │ │ │ └── springboot │ │ │ ├── SpringbootThymeleafHelloWorldExampleApplication.java │ │ │ └── controller │ │ │ └── HelloController.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── hello.html │ └── test │ └── java │ └── net │ └── javaguides │ └── springboot │ └── SpringbootThymeleafHelloWorldExampleApplicationTests.java ├── springboot-thymeleaf-security-demo ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ └── org.eclipse.wst.common.project.facet.core.xml ├── .springBeans ├── README.md ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── javaguides │ │ └── springbootsecurity │ │ ├── SpringbootThymeleafSecurityDemoApplication.java │ │ ├── config │ │ ├── WebConfig.java │ │ └── WebSecurityConfig.java │ │ ├── entities │ │ ├── Message.java │ │ ├── Role.java │ │ └── User.java │ │ ├── repositories │ │ ├── MessageRepository.java │ │ └── UserRepository.java │ │ ├── security │ │ ├── AuthenticatedUser.java │ │ └── CustomUserDetailsService.java │ │ └── web │ │ └── HomeController.java │ └── resources │ ├── application.properties │ ├── data.sql │ ├── messages.properties │ ├── static │ ├── assets │ │ ├── bootstrap │ │ │ ├── css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ └── bootstrap.min.css │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ └── bootstrap.min.js │ │ ├── css │ │ │ └── styles.css │ │ ├── font-awesome-4.5.0 │ │ │ ├── HELP-US-OUT.txt │ │ │ ├── css │ │ │ │ ├── font-awesome.css │ │ │ │ └── font-awesome.min.css │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ ├── less │ │ │ │ ├── animated.less │ │ │ │ ├── bordered-pulled.less │ │ │ │ ├── core.less │ │ │ │ ├── fixed-width.less │ │ │ │ ├── font-awesome.less │ │ │ │ ├── icons.less │ │ │ │ ├── larger.less │ │ │ │ ├── list.less │ │ │ │ ├── mixins.less │ │ │ │ ├── path.less │ │ │ │ ├── rotated-flipped.less │ │ │ │ ├── stacked.less │ │ │ │ └── variables.less │ │ │ └── scss │ │ │ │ ├── _animated.scss │ │ │ │ ├── _bordered-pulled.scss │ │ │ │ ├── _core.scss │ │ │ │ ├── _fixed-width.scss │ │ │ │ ├── _icons.scss │ │ │ │ ├── _larger.scss │ │ │ │ ├── _list.scss │ │ │ │ ├── _mixins.scss │ │ │ │ ├── _path.scss │ │ │ │ ├── _rotated-flipped.scss │ │ │ │ ├── _stacked.scss │ │ │ │ ├── _variables.scss │ │ │ │ └── font-awesome.scss │ │ └── js │ │ │ └── jquery-2.1.4.min.js │ └── error │ │ └── 403.html │ └── templates │ ├── adminhome.html │ ├── index.html │ ├── layout.html │ ├── login.html │ └── userhome.html ├── springboot-upload-download-file-database ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── javaguides │ │ └── springboot │ │ └── fileuploaddownload │ │ ├── SpringbootUploadDownloadFileApplication.java │ │ ├── controller │ │ ├── FileDownloadController.java │ │ └── FileUploadController.java │ │ ├── exception │ │ ├── FileNotFoundException.java │ │ └── FileStorageException.java │ │ ├── model │ │ └── DatabaseFile.java │ │ ├── payload │ │ └── Response.java │ │ └── service │ │ ├── DatabaseFileService.java │ │ └── repository │ │ └── DatabaseFileRepository.java │ └── resources │ └── application.properties ├── springboot-upload-download-file-rest-api-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── net │ │ │ │ └── javaguides │ │ │ │ └── springboot │ │ │ │ └── fileuploaddownload │ │ │ │ ├── SpringbootUploadDownloadFileApplication.java │ │ │ │ ├── controller │ │ │ │ ├── FileDownloadController.java │ │ │ │ └── FileUploadController.java │ │ │ │ ├── exception │ │ │ │ ├── FileNotFoundException.java │ │ │ │ └── FileStorageException.java │ │ │ │ ├── payload │ │ │ │ └── Response.java │ │ │ │ ├── property │ │ │ │ └── FileStorageProperties.java │ │ │ │ └── service │ │ │ │ └── FileStorageService.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── net │ │ └── javaguides │ │ └── springboot │ │ └── fileuploaddownload │ │ └── SpringbootUploadDownloadFileApplicationTests.java └── uploads │ ├── new-junior-born.png │ ├── project-structure.PNG │ └── spring-web-annotations.PNG ├── springboot2-annotation-config ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2annotationconfig │ │ │ ├── Springboot2AnnotationConfigApplication.java │ │ │ └── service │ │ │ ├── EmailService.java │ │ │ ├── MessageService.java │ │ │ ├── SMSService.java │ │ │ ├── TwitterService.java │ │ │ ├── UserService.java │ │ │ └── UserServiceImpl.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2annotationconfig │ └── Springboot2AnnotationConfigApplicationTests.java ├── springboot2-externalizing-conf-properties ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── myapp.log ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2externalizingconfproperties │ │ │ ├── Application.java │ │ │ ├── DataSourceConfig.java │ │ │ └── PropertyController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2externalizingconfproperties │ └── ApplicationTests.java ├── springboot2-freemarker-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── guides │ │ └── springboot2 │ │ └── freemarker │ │ ├── Application.java │ │ ├── controller │ │ └── EmployeeController.java │ │ ├── model │ │ └── Employee.java │ │ └── repository │ │ └── EmployeeRepository.java │ └── resources │ ├── application.properties │ └── templates │ ├── index.ftl │ └── showEmployees.ftl ├── springboot2-java-config ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2javaconfig │ │ │ ├── Springboot2JavaConfigApplication.java │ │ │ └── service │ │ │ ├── EmailService.java │ │ │ ├── MessageProcessor.java │ │ │ ├── MessageProcessorImpl.java │ │ │ ├── MessageService.java │ │ │ ├── SMSService.java │ │ │ └── TwitterService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2javaconfig │ └── Springboot2JavaConfigApplicationTests.java ├── springboot2-jdbc-crud-mysql-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── jdbc │ │ │ ├── Application.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeJDBCRepository.java │ └── resources │ │ ├── application.properties │ │ ├── data.sql │ │ └── schema.sql │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2jpacrudexample │ ├── ApplicationTests.java │ └── EmployeeControllerIntegrationTest.java ├── springboot2-jms-activemq ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── net │ │ └── javaguides │ │ └── springboot │ │ ├── Application.java │ │ └── jms │ │ ├── Confirmation.java │ │ ├── ConfirmationReceiver.java │ │ ├── ConfirmationSender.java │ │ ├── User.java │ │ └── UserReceiver.java │ └── resources │ └── logback.xml ├── springboot2-jpa-auditing ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot │ │ │ └── springboot2jpaauditing │ │ │ ├── Springboot2JpaAuditingApplication.java │ │ │ ├── audit │ │ │ ├── Auditable.java │ │ │ └── AuditorAwareImpl.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot │ └── springboot2jpaauditing │ └── Springboot2JpaAuditingApplicationTests.java ├── springboot2-jpa-crud-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2jpacrudexample │ │ │ ├── Application.java │ │ │ ├── SpringRestClient.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── exception │ │ │ ├── ErrorDetails.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2jpacrudexample │ ├── ApplicationTests.java │ └── EmployeeControllerIntegrationTest.java ├── springboot2-jpa-h2-crud-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2jpacrudexample │ │ │ ├── Application.java │ │ │ ├── SpringRestClient.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── exception │ │ │ ├── ErrorDetails.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2jpacrudexample │ ├── ApplicationTests.java │ └── EmployeeControllerIntegrationTest.java ├── springboot2-jpa-swagger2 ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2swagger2 │ │ │ ├── Springboot2Swagger2Application.java │ │ │ ├── config │ │ │ └── Swagger2Config.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── exception │ │ │ ├── ErrorDetails.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2jpaswagger2 │ └── Springboot2Swagger2ApplicationTests.java ├── springboot2-junit5-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2junit5example │ │ │ ├── Springboot2Junit5ExampleApplication.java │ │ │ └── controller │ │ │ └── MessageController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2junit5example │ └── Springboot2Junit5ExampleApplicationTests.java ├── springboot2-logging ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── app.log ├── mvnw ├── mvnw.cmd ├── myapp.log ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2logging │ │ │ ├── Article.java │ │ │ ├── ArticleController.java │ │ │ ├── ArticleService.java │ │ │ └── Springboot2LoggingApplication.java │ └── resources │ │ ├── application.properties │ │ └── logback.xml │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2logging │ └── Springboot2LoggingApplicationTests.java ├── springboot2-mybatis-mysql-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── jdbc │ │ │ ├── Application.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeMyBatisRepository.java │ └── resources │ │ ├── application.properties │ │ ├── data.sql │ │ └── schema.sql │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2jpacrudexample │ ├── ApplicationTests.java │ └── EmployeeControllerIntegrationTest.java ├── springboot2-springaop-example ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2jpacrudexample │ │ │ ├── Application.java │ │ │ ├── SpringRestClient.java │ │ │ ├── aspect │ │ │ └── LoggingAspect.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── exception │ │ │ ├── ErrorDetails.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ ├── repository │ │ │ └── EmployeeRepository.java │ │ │ └── service │ │ │ └── EmployeeService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2jpacrudexample │ └── ApplicationTests.java ├── springboot2-webapp-jsp-WAR ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2webappjsp │ │ │ ├── Springboot2WebappJspApplication.java │ │ │ ├── controllers │ │ │ └── UserController.java │ │ │ ├── domain │ │ │ └── User.java │ │ │ └── repositories │ │ │ └── UserRepository.java │ ├── resources │ │ └── application.properties │ └── webapp │ │ └── WEB-INF │ │ └── jsp │ │ └── users.jsp │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2webappjsp │ └── Springboot2WebappJspApplicationTests.java ├── springboot2-webapp-jsp ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2webappjsp │ │ │ ├── Springboot2WebappJspApplication.java │ │ │ ├── controllers │ │ │ └── UserController.java │ │ │ ├── domain │ │ │ └── User.java │ │ │ └── repositories │ │ │ └── UserRepository.java │ ├── resources │ │ └── application.properties │ └── webapp │ │ └── WEB-INF │ │ └── jsp │ │ └── users.jsp │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2webappjsp │ └── Springboot2WebappJspApplicationTests.java ├── springboot2-webapp-thymeleaf ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── guides │ │ │ └── springboot2 │ │ │ └── springboot2webappthymeleaf │ │ │ ├── Springboot2WebappThymeleafApplication.java │ │ │ ├── controllers │ │ │ └── HomeController.java │ │ │ ├── domain │ │ │ └── User.java │ │ │ └── repositories │ │ │ └── UserRepository.java │ └── resources │ │ ├── application-prod.properties │ │ ├── application.properties │ │ ├── data.sql │ │ ├── messages.properties │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── net │ └── guides │ └── springboot2 │ └── springboot2webappthymeleaf │ └── Springboot2WebappThymeleafApplicationTests.java └── springboot2-xml-config ├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src ├── main ├── java │ └── net │ │ └── guides │ │ └── springboot2 │ │ └── springboot2xmlconfig │ │ ├── Springboot2XmlConfigApplication.java │ │ ├── model │ │ └── Message.java │ │ └── service │ │ ├── EmailService.java │ │ ├── MessageProcessor.java │ │ ├── MessageProcessorImpl.java │ │ ├── MessageService.java │ │ ├── SMSService.java │ │ └── TwitterService.java └── resources │ ├── application.properties │ └── applicationContext.xml └── test └── java └── net └── guides └── springboot2 └── springboot2xmlconfig └── Springboot2XmlConfigApplicationTests.java /login-registration-springboot-hibernate-jsp-auth/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.8 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 13 | org.eclipse.jdt.core.compiler.release=disabled 14 | org.eclipse.jdt.core.compiler.source=1.8 15 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/.settings/org.springframework.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | boot.validation.initialized=true 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/src/main/java/net/guides/springboot/loginregistrationspringbootauthjsp/Application.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.loginregistrationspringbootauthjsp; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | public static void main(String[] args) throws Exception { 9 | SpringApplication.run(Application.class, args); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/src/main/java/net/guides/springboot/loginregistrationspringbootauthjsp/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.loginregistrationspringbootauthjsp.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import net.guides.springboot.loginregistrationspringbootauthjsp.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | } 9 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/src/main/java/net/guides/springboot/loginregistrationspringbootauthjsp/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.loginregistrationspringbootauthjsp.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import net.guides.springboot.loginregistrationspringbootauthjsp.model.User; 6 | 7 | public interface UserRepository extends JpaRepository { 8 | User findByUsername(String username); 9 | } 10 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/src/main/java/net/guides/springboot/loginregistrationspringbootauthjsp/service/UserService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.loginregistrationspringbootauthjsp.service; 2 | 3 | import net.guides.springboot.loginregistrationspringbootauthjsp.model.User; 4 | 5 | public interface UserService { 6 | void save(User user); 7 | 8 | User findByUsername(String username); 9 | } 10 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring view resolver set up 2 | spring.mvc.view.prefix=/WEB-INF/jsp/ 3 | spring.mvc.view.suffix=.jsp 4 | 5 | spring.datasource.url=jdbc:mysql://localhost:3306/demo?useSSL=false 6 | spring.datasource.username=root 7 | spring.datasource.password=Mysql@123 8 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 9 | spring.jpa.hibernate.ddl-auto = update 10 | 11 | spring.messages.basename=validation 12 | 13 | logging.level.root = INFO,ERROR 14 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/src/main/resources/validation.properties: -------------------------------------------------------------------------------- 1 | NotEmpty=This field is required. 2 | Size.userForm.username=Please use between 6 and 32 characters. 3 | Duplicate.userForm.username=Someone already has that username. 4 | Size.userForm.password=Try one with at least 8 characters. 5 | Diff.userForm.passwordConfirm=These passwords don't match. -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /login-registration-springboot-hibernate-jsp-auth/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /spring-aop-advice-examples/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /spring-aop-advice-examples/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/spring-aop-advice-examples/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-aop-advice-examples/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /spring-aop-advice-examples/src/main/java/net/guides/springboot2/springboot2jpacrudexample/Application.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.client.RestTemplateBuilder; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.web.client.RestTemplate; 8 | 9 | @SpringBootApplication 10 | public class Application { 11 | 12 | @Bean 13 | public RestTemplate restTemplate(RestTemplateBuilder builder) { 14 | return builder.build(); 15 | } 16 | 17 | public static void main(String[] args) { 18 | SpringApplication.run(Application.class, args); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-aop-advice-examples/src/main/java/net/guides/springboot2/springboot2jpacrudexample/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-aop-advice-examples/src/main/java/net/guides/springboot2/springboot2jpacrudexample/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-aop-advice-examples/src/main/java/net/guides/springboot2/springboot2jpacrudexample/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot2.springboot2jpacrudexample.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /spring-aop-advice-examples/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | #spring.datasource.url = jdbc:mysql://localhost:3306/users_database?useSSL=false 3 | #spring.datasource.username = root 4 | #spring.datasource.password = root 5 | 6 | 7 | ## Hibernate Properties 8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | #spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | #spring.jpa.hibernate.ddl-auto = update 13 | 14 | info.app.name=Spring Boot - RestTemplate CRUD Rest Client Example 15 | info.app.description=Spring Boot - RestTemplate CRUD Rest Client Example 16 | info.app.version=1.0.0 17 | 18 | logging.level.org.springframework.web=INFO 19 | logging.level.org.hibernate=ERROR 20 | logging.level.net.guides=DEBUG -------------------------------------------------------------------------------- /spring-aop-advice-examples/src/test/java/net/guides/springboot2/springboot2jpacrudexample/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-crud-rest/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /spring-boot-crud-rest/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/spring-boot-crud-rest/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-boot-crud-rest/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip 2 | -------------------------------------------------------------------------------- /spring-boot-crud-rest/src/main/java/com/companyname/springbootcrudrest/SpringBootCrudRestApplication.java: -------------------------------------------------------------------------------- 1 | package com.companyname.springbootcrudrest; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing 9 | public class SpringBootCrudRestApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootCrudRestApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-crud-rest/src/main/java/com/companyname/springbootcrudrest/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package com.companyname.springbootcrudrest.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-boot-crud-rest/src/main/java/com/companyname/springbootcrudrest/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.companyname.springbootcrudrest.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-crud-rest/src/main/java/com/companyname/springbootcrudrest/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.companyname.springbootcrudrest.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.companyname.springbootcrudrest.model.User; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /spring-boot-crud-rest/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url = jdbc:mysql://localhost:3306/users_database?useSSL=false 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | 6 | 7 | ## Hibernate Properties 8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update -------------------------------------------------------------------------------- /spring-propertysource-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /spring-propertysource-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/spring-propertysource-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring-propertysource-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /spring-propertysource-example/src/main/java/net/guides/springboot2/springpropertysourceexample/Application.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springpropertysourceexample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.annotation.Import; 6 | 7 | @SpringBootApplication 8 | public class Application { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(Application.class, args); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /spring-propertysource-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.web=INFO 2 | logging.level.org.hibernate=ERROR 3 | logging.level.net.guides=DEBUG 4 | 5 | logging.file=myapp.log -------------------------------------------------------------------------------- /spring-propertysource-example/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | jdbc.driver=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://localhost:3306/dev_db 3 | jdbc.username=root 4 | jdbc.password=root -------------------------------------------------------------------------------- /spring-propertysource-example/src/test/java/net/guides/springboot2/springpropertysourceexample/SpringPropertysourceExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springpropertysourceexample; 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 SpringPropertysourceExampleApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-angular8-helloworld-example/Springboot-helloworld-application/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-angular8-helloworld-example/Springboot-helloworld-application/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-angular8-helloworld-example/Springboot-helloworld-application/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-angular8-helloworld-example/Springboot-helloworld-application/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-angular8-helloworld-example/Springboot-helloworld-application/src/main/java/net/javaguides/springboot/Springboothelloworldapplication/Application.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.Springboothelloworldapplication; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-angular8-helloworld-example/Springboot-helloworld-application/src/main/java/net/javaguides/springboot/Springboothelloworldapplication/Greeting.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.Springboothelloworldapplication; 2 | 3 | public class Greeting { 4 | private final long id; 5 | private final String content; 6 | 7 | public Greeting(long id, String content) { 8 | this.id = id; 9 | this.content = content; 10 | } 11 | 12 | public long getId() { 13 | return id; 14 | } 15 | 16 | public String getContent() { 17 | return content; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /springboot-angular8-helloworld-example/Springboot-helloworld-application/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.servlet.context-path=/hello-world -------------------------------------------------------------------------------- /springboot-angular8-helloworld-example/Springboot-helloworld-application/src/test/java/net/javaguides/springboot/Springboothelloworldapplication/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.Springboothelloworldapplication; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-async-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-async-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-async-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-async-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-async-example/src/main/java/net/guides/springboot/springbootasyncexample/model/User.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springbootasyncexample.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | @JsonIgnoreProperties(ignoreUnknown=true) 6 | public class User { 7 | 8 | private String name; 9 | private String blog; 10 | 11 | public String getName() { 12 | return name; 13 | } 14 | 15 | public void setName(String name) { 16 | this.name = name; 17 | } 18 | 19 | public String getBlog() { 20 | return blog; 21 | } 22 | 23 | public void setBlog(String blog) { 24 | this.blog = blog; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return "User [name=" + name + ", blog=" + blog + "]"; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /springboot-async-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-async-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-async-example/src/test/java/net/guides/springboot/springbootasyncexample/SpringbootAsyncApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springbootasyncexample; 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 SpringbootAsyncApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/.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 | -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-crud-hibernate-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/.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 | -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/src/main/java/net/javaguides/springboot/SpringbootCrudHibernateExampleApplication.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootCrudHibernateExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootCrudHibernateExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/src/main/java/net/javaguides/springboot/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.exception; 2 | 3 | import org.springframework.web.bind.annotation.ResponseStatus; 4 | 5 | @ResponseStatus 6 | public class ResourceNotFoundException extends RuntimeException { 7 | 8 | private static final long serialVersionUID = 1L; 9 | 10 | public ResourceNotFoundException(String message) { 11 | super(message); 12 | } 13 | 14 | public ResourceNotFoundException(String message, Throwable throwable) { 15 | super(message, throwable); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/src/main/java/net/javaguides/springboot/repository/ProductRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import net.javaguides.springboot.model.Product; 6 | 7 | public interface ProductRepository extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/src/main/java/net/javaguides/springboot/service/ProductService.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.service; 2 | 3 | import java.util.List; 4 | 5 | import net.javaguides.springboot.model.Product; 6 | 7 | public interface ProductService { 8 | Product createProduct(Product product); 9 | 10 | Product updateProduct(Product product); 11 | 12 | List getAllProduct(); 13 | 14 | Product getProductById(long productId); 15 | 16 | void deleteProduct(long id); 17 | } 18 | -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # h2 database 2 | 3 | spring.h2.console.enabled=true 4 | spring.h2.console.path=/h2 5 | 6 | spring.jpa.hibernate.ddl-auto=create-drop 7 | spring.jpa.show-sql=true 8 | -------------------------------------------------------------------------------- /springboot-crud-hibernate-example/src/test/java/net/javaguides/springboot/SpringbootCrudHibernateExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 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 SpringbootCrudHibernateExampleApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-crud-rest-api-validation/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/src/main/java/net/guides/springboot/springbootcrudrestapivalidation/SpringbootCrudRestApiValidationApplication.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springbootcrudrestapivalidation; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootCrudRestApiValidationApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootCrudRestApiValidationApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/src/main/java/net/guides/springboot/springbootcrudrestapivalidation/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springbootcrudrestapivalidation.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/src/main/java/net/guides/springboot/springbootcrudrestapivalidation/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springbootcrudrestapivalidation.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/src/main/java/net/guides/springboot/springbootcrudrestapivalidation/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springbootcrudrestapivalidation.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot.springbootcrudrestapivalidation.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url = jdbc:mysql://localhost:3306/users_database?useSSL=false 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | 6 | 7 | ## Hibernate Properties 8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update -------------------------------------------------------------------------------- /springboot-crud-rest-api-validation/src/test/java/net/guides/springboot/springbootcrudrestapivalidation/SpringbootCrudRestApiValidationApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springbootcrudrestapivalidation; 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 SpringbootCrudRestApiValidationApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-hibernate-composite-key-demo/.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 | -------------------------------------------------------------------------------- /springboot-hibernate-composite-key-demo/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-hibernate-composite-key-demo/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-hibernate-composite-key-demo/.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 | -------------------------------------------------------------------------------- /springboot-hibernate-composite-key-demo/src/main/java/net/javaguides/springboot/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import net.javaguides.springboot.entity.Employee; 9 | import net.javaguides.springboot.entity.EmployeeIdentity; 10 | 11 | @Repository 12 | public interface EmployeeRepository extends JpaRepository { 13 | 14 | /* 15 | * Spring Data JPA will automatically parse this method name and create a query 16 | * from it 17 | */ 18 | List findByEmployeeIdentityCompanyId(String companyId); 19 | } 20 | -------------------------------------------------------------------------------- /springboot-hibernate-composite-key-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url=jdbc:mysql://localhost:3306/demo?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | 6 | # Hibernate 7 | 8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update 13 | 14 | logging.level.org.hibernate.SQL=DEBUG 15 | logging.level.org.hibernate.type=TRACE 16 | -------------------------------------------------------------------------------- /springboot-hibernate-composite-key-demo/src/test/java/net/javaguides/springboot/SpringbootHibernateCompositeKeyDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootHibernateCompositeKeyDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-hibernate-many-to-many-mapping/.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 | -------------------------------------------------------------------------------- /springboot-hibernate-many-to-many-mapping/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-hibernate-many-to-many-mapping/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-hibernate-many-to-many-mapping/.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 | -------------------------------------------------------------------------------- /springboot-hibernate-many-to-many-mapping/src/main/java/net/javaguides/springboot/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.javaguides.springboot.entity.Post; 7 | 8 | @Repository 9 | public interface PostRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-hibernate-many-to-many-mapping/src/main/java/net/javaguides/springboot/repository/TagRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.javaguides.springboot.entity.Tag; 7 | 8 | @Repository 9 | public interface TagRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-hibernate-many-to-many-mapping/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/demo?useSSL=false 2 | spring.datasource.username = root 3 | spring.datasource.password = root 4 | 5 | 6 | ## Hibernate Properties 7 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 8 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 9 | 10 | # Hibernate ddl auto (create, create-drop, validate, update) 11 | spring.jpa.hibernate.ddl-auto = update 12 | 13 | logging.level.org.hibernate.SQL=DEBUG 14 | 15 | -------------------------------------------------------------------------------- /springboot-hibernate-many-to-many-mapping/src/test/java/net/javaguides/springboot/SpringbootHibernateManyToManyMappingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootHibernateManyToManyMappingApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-hibernate-one-many-mapping/.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 | -------------------------------------------------------------------------------- /springboot-hibernate-one-many-mapping/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-hibernate-one-many-mapping/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-hibernate-one-many-mapping/.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 | -------------------------------------------------------------------------------- /springboot-hibernate-one-many-mapping/src/main/java/net/javaguides/springboot/entity/Comment.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.entity; 2 | 3 | import jakarta.persistence.*; 4 | 5 | @Entity 6 | @Table(name = "comments") 7 | public class Comment { 8 | 9 | @Id 10 | @GeneratedValue(strategy = GenerationType.IDENTITY) 11 | private long id; 12 | private String text; 13 | 14 | public Comment() { 15 | 16 | } 17 | 18 | public Comment(String text) { 19 | super(); 20 | this.text = text; 21 | } 22 | public long getId() { 23 | return id; 24 | } 25 | public void setId(long id) { 26 | this.id = id; 27 | } 28 | public String getText() { 29 | return text; 30 | } 31 | public void setText(String text) { 32 | this.text = text; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /springboot-hibernate-one-many-mapping/src/main/java/net/javaguides/springboot/repository/CommentRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.javaguides.springboot.entity.Comment; 7 | 8 | @Repository 9 | public interface CommentRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-hibernate-one-many-mapping/src/main/java/net/javaguides/springboot/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.javaguides.springboot.entity.Post; 7 | 8 | @Repository 9 | public interface PostRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-hibernate-one-many-mapping/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url=jdbc:mysql://localhost:3306/demo?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | 6 | # Hibernate 7 | 8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update 13 | 14 | logging.level.org.hibernate.SQL=DEBUG 15 | logging.level.org.hibernate.type=TRACE 16 | -------------------------------------------------------------------------------- /springboot-hibernate-one-many-mapping/src/test/java/net/javaguides/springboot/SpringbootHibernateOneManyMappingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootHibernateOneManyMappingApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-hibernate-one-one-mapping/.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 | -------------------------------------------------------------------------------- /springboot-hibernate-one-one-mapping/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-hibernate-one-one-mapping/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-hibernate-one-one-mapping/.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 | -------------------------------------------------------------------------------- /springboot-hibernate-one-one-mapping/src/main/java/net/javaguides/springboot/entity/Gender.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.entity; 2 | 3 | public enum Gender { 4 | MALE, FEMALE 5 | 6 | } 7 | -------------------------------------------------------------------------------- /springboot-hibernate-one-one-mapping/src/main/java/net/javaguides/springboot/repository/UserProfileRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.javaguides.springboot.entity.UserProfile; 7 | 8 | @Repository 9 | public interface UserProfileRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-hibernate-one-one-mapping/src/main/java/net/javaguides/springboot/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.javaguides.springboot.entity.User; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-hibernate-one-one-mapping/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/demo?useSSL=false 2 | spring.datasource.username = root 3 | spring.datasource.password = root 4 | 5 | 6 | ## Hibernate Properties 7 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 8 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 9 | 10 | # Hibernate ddl auto (create, create-drop, validate, update) 11 | spring.jpa.hibernate.ddl-auto = update 12 | 13 | logging.level.org.hibernate.SQL=DEBUG 14 | -------------------------------------------------------------------------------- /springboot-hibernate-one-one-mapping/src/test/java/net/javaguides/springboot/SpringbootHibernateOneOneMappingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootHibernateOneOneMappingApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-jpa-one-to-one-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-jpa-one-to-one-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-jpa-one-to-one-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-jpa-one-to-one-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-jpa-one-to-one-example/src/main/java/net/guides/springboot/jpa/controller/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.jpa.controller; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-jpa-one-to-one-example/src/main/java/net/guides/springboot/jpa/repository/InstructorRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.jpa.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot.jpa.model.Instructor; 7 | 8 | @Repository 9 | public interface InstructorRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-jpa-one-to-one-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.main.banner-mode=off 2 | logging.pattern.console=%clr(%d{yy-MM-dd E HH:mm:ss.SSS}){blue} %clr(%-5p) %clr(%logger{0}){blue} %clr(%m){faint}%n 3 | 4 | spring.datasource.url=jdbc:mysql://localhost:3306/demo?useSSL=false 5 | spring.datasource.username=root 6 | spring.datasource.password=root 7 | 8 | spring.jpa.hibernate.ddl-auto=update 9 | spring.jpa.database-platform=org.hibernate.dialect.MySQL57Dialect 10 | spring.jpa.generate-ddl=true 11 | spring.jpa.show-sql=true -------------------------------------------------------------------------------- /springboot-jsp-hello-world-example/.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 | -------------------------------------------------------------------------------- /springboot-jsp-hello-world-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-jsp-hello-world-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-jsp-hello-world-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 | -------------------------------------------------------------------------------- /springboot-jsp-hello-world-example/src/main/java/net/javaguides/springboot/SpringbootJspHelloWorldExampleApplication.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootJspHelloWorldExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootJspHelloWorldExampleApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-jsp-hello-world-example/src/main/java/net/javaguides/springboot/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.controller; 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.RequestParam; 7 | 8 | @Controller 9 | public class HelloController { 10 | 11 | @GetMapping({"/", "/hello"}) 12 | public String hello(@RequestParam(value = "name", defaultValue = "World", 13 | required = true) String name, Model model) { 14 | model.addAttribute("name", name); 15 | return "hello"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /springboot-jsp-hello-world-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.view.prefix=/WEB-INF/jsp/ 2 | spring.mvc.view.suffix=.jsp 3 | -------------------------------------------------------------------------------- /springboot-jsp-hello-world-example/src/main/webapp/WEB-INF/jsp/hello.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 |

Hello ${name}!

11 | 12 | -------------------------------------------------------------------------------- /springboot-jsp-hello-world-example/src/test/java/net/javaguides/springboot/SpringbootJspHelloWorldExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootJspHelloWorldExampleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mongodb-crud/.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 | -------------------------------------------------------------------------------- /springboot-mongodb-crud/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-mongodb-crud/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-mongodb-crud/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /springboot-mongodb-crud/src/main/java/net/springboot/javaguides/Application.java: -------------------------------------------------------------------------------- 1 | package net.springboot.javaguides; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-mongodb-crud/src/main/java/net/springboot/javaguides/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.springboot.javaguides.exception; 2 | 3 | import org.springframework.web.bind.annotation.ResponseStatus; 4 | 5 | @ResponseStatus 6 | public class ResourceNotFoundException extends RuntimeException { 7 | 8 | private static final long serialVersionUID = 1L; 9 | 10 | public ResourceNotFoundException(String message) { 11 | super(message); 12 | } 13 | 14 | public ResourceNotFoundException(String message, Throwable throwable) { 15 | super(message, throwable); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /springboot-mongodb-crud/src/main/java/net/springboot/javaguides/repository/ProductRepository.java: -------------------------------------------------------------------------------- 1 | package net.springboot.javaguides.repository; 2 | 3 | import org.springframework.data.mongodb.repository.MongoRepository; 4 | 5 | import net.springboot.javaguides.model.Product; 6 | 7 | public interface ProductRepository extends MongoRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot-mongodb-crud/src/main/java/net/springboot/javaguides/service/ProductService.java: -------------------------------------------------------------------------------- 1 | package net.springboot.javaguides.service; 2 | 3 | import java.util.List; 4 | 5 | import net.springboot.javaguides.model.Product; 6 | 7 | public interface ProductService { 8 | Product createProduct(Product product); 9 | 10 | Product updateProduct(Product product); 11 | 12 | List getAllProduct(); 13 | 14 | Product getProductById(long productId); 15 | 16 | void deleteProduct(long id); 17 | } 18 | -------------------------------------------------------------------------------- /springboot-mongodb-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # MONGODB (MongoProperties) 2 | spring.data.mongodb.uri=mongodb://localhost:27017/ProductDB -------------------------------------------------------------------------------- /springboot-mongodb-crud/src/test/java/net/springboot/javaguides/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.springboot.javaguides; 2 | 3 | import org.junit.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mssql-jpa-hibernate-crud-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-mssql-jpa-hibernate-crud-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-mssql-jpa-hibernate-crud-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-mssql-jpa-hibernate-crud-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-mssql-jpa-hibernate-crud-example/src/main/java/net/javaguides/mssql/Application.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.mssql; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing 9 | public class Application { 10 | public static void main(String[] args) { 11 | SpringApplication.run(Application.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mssql-jpa-hibernate-crud-example/src/main/java/net/javaguides/mssql/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.mssql.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot-mssql-jpa-hibernate-crud-example/src/main/java/net/javaguides/mssql/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.mssql.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-mssql-jpa-hibernate-crud-example/src/main/java/net/javaguides/mssql/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.mssql.repository; 2 | 3 | import net.javaguides.mssql.model.Employee; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface EmployeeRepository extends JpaRepository{ 7 | 8 | } 9 | -------------------------------------------------------------------------------- /springboot-mssql-jpa-hibernate-crud-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver 2 | spring.datasource.url=jdbc:sqlserver://localhost;databaseName=employees 3 | spring.datasource.username=sa 4 | spring.datasource.password= 5 | spring.jpa.show-sql=true 6 | spring.jpa.properties.hibernate.format_sql = true 7 | 8 | ## Hibernate Properties 9 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 10 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.SQLServer2012Dialect 11 | 12 | # Hibernate ddl auto (create, create-drop, validate, update) 13 | spring.jpa.hibernate.ddl-auto = update 14 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.methodParameters=generate 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 6 | org.eclipse.jdt.core.compiler.release=disabled 7 | org.eclipse.jdt.core.compiler.source=1.8 8 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/src/main/java/net/guides/springboot/springbootmultipledatasources/orders/repositories/OrderRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package net.guides.springboot.springbootmultipledatasources.orders.repositories; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import net.guides.springboot.springbootmultipledatasources.orders.entities.Order; 9 | 10 | /** 11 | * @author Ramesh Fadatare 12 | * 13 | */ 14 | public interface OrderRepository extends JpaRepository{ 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/src/main/java/net/guides/springboot/springbootmultipledatasources/security/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package net.guides.springboot.springbootmultipledatasources.security.repositories; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | 9 | import net.guides.springboot.springbootmultipledatasources.security.entities.User; 10 | 11 | /** 12 | * @author Ramesh Fadatare 13 | * 14 | */ 15 | public interface UserRepository extends JpaRepository 16 | { 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | 2 | datasource.security.driver-class-name=com.mysql.jdbc.Driver 3 | datasource.security.url=jdbc:mysql://localhost:3306/test 4 | datasource.security.username=root 5 | datasource.security.password=root 6 | 7 | datasource.security.initialize=true 8 | 9 | datasource.orders.driver-class-name=com.mysql.jdbc.Driver 10 | datasource.orders.url=jdbc:mysql://localhost:3306/orders 11 | datasource.orders.username=root 12 | datasource.orders.password=root 13 | 14 | datasource.orders.initialize=true 15 | 16 | spring.jpa.hibernate.ddl-auto=update 17 | spring.jpa.show-sql=true 18 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | debug=true 2 | 3 | datasource.security.driver-class-name=org.h2.Driver 4 | datasource.security.url=jdbc:h2:mem:securitydb;DB_CLOSE_DELAY=-1 5 | datasource.security.username=sa 6 | datasource.security.password= 7 | 8 | datasource.security.initialize=true 9 | 10 | datasource.orders.driver-class-name=org.h2.Driver 11 | datasource.orders.url=jdbc:h2:mem:ordersdb;DB_CLOSE_DELAY=-1 12 | datasource.orders.username=sa 13 | datasource.orders.password= 14 | 15 | datasource.orders.initialize=true 16 | 17 | spring.jpa.hibernate.ddl-auto=update 18 | spring.jpa.show-sql=true 19 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/src/main/resources/orders-data.sql: -------------------------------------------------------------------------------- 1 | delete from order_items; 2 | delete from orders; 3 | 4 | insert into orders(id, cust_name, cust_email) values(1,'Ramesh','ramesh@gmail.com'); 5 | insert into orders(id, cust_name, cust_email) values(2,'Jonn','sanjay@gmail.com'); 6 | insert into orders(id, cust_name, cust_email) values(3,'Salman','salman@gmail.com'); 7 | 8 | insert into order_items(id, productcode,quantity,order_id) values(1,'P100', 2, 1); 9 | insert into order_items(id, productcode,quantity,order_id) values(2,'P101', 1, 1); 10 | insert into order_items(id, productcode,quantity,order_id) values(3,'P102', 5, 1); 11 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/src/main/resources/security-data.sql: -------------------------------------------------------------------------------- 1 | delete from addresses; 2 | delete from users; 3 | 4 | insert into users(id, name, email,disabled) values(1,'Ramesh','ramesh@gmail.com', false); 5 | insert into users(id, name, email,disabled) values(2,'john','john@gmail.com', false); 6 | insert into users(id, name, email,disabled) values(3,'Salman','salman@gmail.com', true); 7 | 8 | insert into addresses(id,city,user_id) values(1, 'City1',1); 9 | insert into addresses(id,city,user_id) values(2, 'City2',1); 10 | insert into addresses(id,city,user_id) values(3, 'City3',2); 11 | -------------------------------------------------------------------------------- /springboot-multiple-datasources/src/test/java/net/guides/springboot/springbootmultipledatasources/SpringbootMultipleDatasourcesApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springbootmultipledatasources; 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 SpringbootMultipleDatasourcesApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-postgresql-jpa-hibernate-crud-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/src/main/java/net/javaguides/postgresql/Application.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.postgresql; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing 9 | public class Application { 10 | public static void main(String[] args) { 11 | SpringApplication.run(Application.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/src/main/java/net/javaguides/postgresql/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.postgresql.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/src/main/java/net/javaguides/postgresql/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.postgresql.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/src/main/java/net/javaguides/postgresql/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.postgresql.repository; 2 | 3 | import net.javaguides.postgresql.model.Employee; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface EmployeeRepository extends JpaRepository{ 9 | 10 | } 11 | -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:postgresql://localhost:5432/employees 2 | spring.datasource.username=postgres 3 | spring.datasource.password=root 4 | spring.jpa.show-sql=true 5 | 6 | ## Hibernate Properties 7 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 8 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 9 | 10 | # Hibernate ddl auto (create, create-drop, validate, update) 11 | spring.jpa.hibernate.ddl-auto = update 12 | -------------------------------------------------------------------------------- /springboot-postgresql-jpa-hibernate-crud-example/src/test/java/net/guides/springboot2/springboot2jpacrudexample/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | target 3 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-stomp-websocket/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-stomp-websocket/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding/=UTF-8 5 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.methodParameters=generate 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 6 | org.eclipse.jdt.core.compiler.release=disabled 7 | org.eclipse.jdt.core.compiler.source=1.8 8 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-stomp-websocket/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /springboot-stomp-websocket/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Mar 01 09:09:11 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip 7 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/src/main/java/net/javaguides/springboot/websocket/Application.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.websocket; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/src/main/java/net/javaguides/springboot/websocket/controller/GreetingController.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.websocket.controller; 2 | 3 | import org.springframework.messaging.handler.annotation.MessageMapping; 4 | import org.springframework.messaging.handler.annotation.SendTo; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.util.HtmlUtils; 7 | 8 | import net.javaguides.springboot.websocket.model.Greeting; 9 | import net.javaguides.springboot.websocket.model.HelloMessage; 10 | 11 | @Controller 12 | public class GreetingController { 13 | 14 | 15 | @MessageMapping("/hello") 16 | @SendTo("/topic/greetings") 17 | public Greeting greeting(HelloMessage message) throws Exception { 18 | Thread.sleep(1000); // simulated delay 19 | return new Greeting("Hello, " + HtmlUtils.htmlEscape(message.getName()) + "!"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/src/main/java/net/javaguides/springboot/websocket/model/Greeting.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.websocket.model; 2 | 3 | public class Greeting { 4 | 5 | private String content; 6 | 7 | public Greeting() { 8 | } 9 | 10 | public Greeting(String content) { 11 | this.content = content; 12 | } 13 | 14 | public String getContent() { 15 | return content; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/src/main/java/net/javaguides/springboot/websocket/model/HelloMessage.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.websocket.model; 2 | 3 | public class HelloMessage { 4 | 5 | private String name; 6 | 7 | public HelloMessage() { 8 | } 9 | 10 | public HelloMessage(String name) { 11 | this.name = name; 12 | } 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot-stomp-websocket/src/main/resources/static/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #f5f5f5; 3 | } 4 | 5 | #main-content { 6 | max-width: 940px; 7 | padding: 2em 3em; 8 | margin: 0 auto 20px; 9 | background-color: #fff; 10 | border: 1px solid #e5e5e5; 11 | -webkit-border-radius: 5px; 12 | -moz-border-radius: 5px; 13 | border-radius: 5px; 14 | } -------------------------------------------------------------------------------- /springboot-testing-examples/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-testing-examples/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-testing-examples/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-testing-examples/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-testing-examples/src/main/java/net/guides/springboot2/springboottestingexamples/SpringbootTestingExamplesApplication.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboottestingexamples; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootTestingExamplesApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootTestingExamplesApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-testing-examples/src/main/java/net/guides/springboot2/springboottestingexamples/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboottestingexamples.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot2.springboottestingexamples.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | Employee findByFirstName(String username); 11 | } 12 | -------------------------------------------------------------------------------- /springboot-testing-examples/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.hibernate.ddl-auto=update 2 | spring.jpa.show-sql=true -------------------------------------------------------------------------------- /springboot-thymeleaf-hello-world-example/.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 | -------------------------------------------------------------------------------- /springboot-thymeleaf-hello-world-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-hello-world-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-thymeleaf-hello-world-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 | -------------------------------------------------------------------------------- /springboot-thymeleaf-hello-world-example/src/main/java/net/javaguides/springboot/SpringbootThymeleafHelloWorldExampleApplication.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootThymeleafHelloWorldExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootThymeleafHelloWorldExampleApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-thymeleaf-hello-world-example/src/main/java/net/javaguides/springboot/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.controller; 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.RequestParam; 7 | 8 | @Controller 9 | public class HelloController { 10 | 11 | @GetMapping({"/", "/hello"}) 12 | public String hello(@RequestParam(value = "name", 13 | defaultValue = "World", required = true) String name, Model model) { 14 | model.addAttribute("name", name); 15 | return "hello"; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /springboot-thymeleaf-hello-world-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springboot-thymeleaf-hello-world-example/src/main/resources/templates/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 |

9 | 10 | -------------------------------------------------------------------------------- /springboot-thymeleaf-hello-world-example/src/test/java/net/javaguides/springboot/SpringbootThymeleafHelloWorldExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootThymeleafHelloWorldExampleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding/=UTF-8 5 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.methodParameters=generate 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 6 | org.eclipse.jdt.core.compiler.release=disabled 7 | org.eclipse.jdt.core.compiler.source=1.8 8 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | java:net.javaguides.springbootsecurity.SpringbootThymeleafSecurityDemoApplication 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot + Spring MVC + Role Based Spring Security + Hibernate + Thymeleaf + MySQL Tutorial 2 | 3 | 4 | **springboot-thymeleaf-security-demo**: This tutorial demonstrates how to secure a SpringBoot +Thymeleaf based web application using Spring Security. 5 | 6 | #### How to run? 7 | 8 | springboot-thymeleaf-security-demo> mvn spring-boot:run 9 | 10 | Go to http://localhost:8080/ 11 | 12 | Login with admin@gmail.com/admin (or) user@gmail.com/user 13 | 14 | 15 | Blog post - https://www.javaguides.net/2018/09/spring-boot-spring-mvc-role-based-spring-security-jpa-thymeleaf-mysql-tutorial.html 16 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip 6 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/java/net/javaguides/springbootsecurity/SpringbootThymeleafSecurityDemoApplication.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springbootsecurity; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootThymeleafSecurityDemoApplication 8 | { 9 | public static void main(String[] args) 10 | { 11 | SpringApplication.run(SpringbootThymeleafSecurityDemoApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/java/net/javaguides/springbootsecurity/repositories/MessageRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springbootsecurity.repositories; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import net.javaguides.springbootsecurity.entities.Message; 6 | 7 | /** 8 | * @author Ramesh Fadatare 9 | * 10 | */ 11 | public interface MessageRepository extends JpaRepository{ 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/java/net/javaguides/springbootsecurity/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springbootsecurity.repositories; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import net.javaguides.springbootsecurity.entities.User; 8 | 9 | 10 | /** 11 | * @author Ramesh Fadatare 12 | * 13 | */ 14 | public interface UserRepository extends JpaRepository 15 | { 16 | 17 | Optional findByEmail(String email); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | ################### DataSource Configuration ########################## 3 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 4 | spring.datasource.url=jdbc:mysql://localhost:3306/test 5 | spring.datasource.username=root 6 | spring.datasource.password=root 7 | 8 | spring.datasource.initialization-mode=always 9 | 10 | ################### Hibernate Configuration ########################## 11 | 12 | spring.jpa.hibernate.ddl-auto=update 13 | spring.jpa.show-sql=true 14 | 15 | #security.user.name=admin 16 | #security.user.password=secret 17 | #security.user.role=USER,ADMIN 18 | 19 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | 2 | create table if not exists persistent_logins ( 3 | username varchar(100) not null, 4 | series varchar(64) primary key, 5 | token varchar(64) not null, 6 | last_used timestamp not null 7 | ); 8 | 9 | delete from user_role; 10 | delete from roles; 11 | delete from users; 12 | 13 | 14 | INSERT INTO roles (id, name) VALUES 15 | (1, 'ROLE_ADMIN'), 16 | (2, 'ROLE_ACTUATOR'), 17 | (3, 'ROLE_USER') 18 | ; 19 | 20 | INSERT INTO users (id, email, password, name) VALUES 21 | (1, 'admin@gmail.com', '$2a$10$hKDVYxLefVHV/vtuPhWD3OigtRyOykRLDdUAp80Z1crSoS1lFqaFS', 'Admin'), 22 | (3, 'user@gmail.com', '$2a$10$ByIUiNaRfBKSV6urZoBBxe4UbJ/sS6u1ZaPORHF9AtNWAuVPVz1by', 'User'); 23 | 24 | 25 | insert into user_role(user_id, role_id) values 26 | (1,1), 27 | (1,2), 28 | (1,3), 29 | (3,2) 30 | ; 31 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | label.email=Email 2 | label.password=Password 3 | label.login=Login 4 | label.submit=Submit 5 | 6 | info.logout_success=You have been logged out 7 | error.login_failed=Invalid Email and Password 8 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/css/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 75px; 3 | } -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fonticons (https://fonticons.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/assets/font-awesome-4.5.0/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/static/error/403.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | AccessDenied 9 | 10 | 11 |

You are not authorized to view this page!!

12 | 13 | 14 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/templates/adminhome.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Admin Home 10 | 11 | 12 |
13 |

Welcome Administrator(Admin)

14 |

Logout

15 |
16 |

This is admin home page

17 | 18 | 19 | -------------------------------------------------------------------------------- /springboot-thymeleaf-security-demo/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Home 10 | 11 | 12 |
13 | 14 |

Login

15 |

User Home

16 |

Admin Home

17 |

Logout

18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /springboot-upload-download-file-database/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-upload-download-file-database/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-upload-download-file-database/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-upload-download-file-database/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-upload-download-file-database/src/main/java/net/javaguides/springboot/fileuploaddownload/SpringbootUploadDownloadFileApplication.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootUploadDownloadFileApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootUploadDownloadFileApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-upload-download-file-database/src/main/java/net/javaguides/springboot/fileuploaddownload/exception/FileNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class FileNotFoundException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public FileNotFoundException(String message) { 12 | super(message); 13 | } 14 | 15 | public FileNotFoundException(String message, Throwable cause) { 16 | super(message, cause); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /springboot-upload-download-file-database/src/main/java/net/javaguides/springboot/fileuploaddownload/exception/FileStorageException.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload.exception; 2 | 3 | public class FileStorageException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public FileStorageException(String message) { 8 | super(message); 9 | } 10 | 11 | public FileStorageException(String message, Throwable cause) { 12 | super(message, cause); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-upload-download-file-database/src/main/java/net/javaguides/springboot/fileuploaddownload/service/repository/DatabaseFileRepository.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload.service.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.javaguides.springboot.fileuploaddownload.model.DatabaseFile; 7 | 8 | @Repository 9 | public interface DatabaseFileRepository extends JpaRepository { 10 | 11 | } -------------------------------------------------------------------------------- /springboot-upload-download-file-database/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url= jdbc:mysql://localhost:3306/springboot_demo?useSSL=false 2 | spring.datasource.username= root 3 | spring.datasource.password= root 4 | 5 | ## Hibernate Properties 6 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 7 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect 8 | spring.jpa.hibernate.ddl-auto = update 9 | 10 | ## Hibernate Logging 11 | logging.level.org.hibernate.SQL= DEBUG 12 | 13 | ## MULTIPART (MultipartProperties) 14 | # Enable multipart uploads 15 | spring.servlet.multipart.enabled=true 16 | # Threshold after which files are written to disk. 17 | spring.servlet.multipart.file-size-threshold=2KB 18 | # Max file size. 19 | spring.servlet.multipart.max-file-size=200MB 20 | # Max Request Size 21 | spring.servlet.multipart.max-request-size=215MB -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-upload-download-file-rest-api-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/src/main/java/net/javaguides/springboot/fileuploaddownload/SpringbootUploadDownloadFileApplication.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootUploadDownloadFileApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootUploadDownloadFileApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/src/main/java/net/javaguides/springboot/fileuploaddownload/exception/FileNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(HttpStatus.NOT_FOUND) 7 | public class FileNotFoundException extends RuntimeException { 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public FileNotFoundException(String message) { 12 | super(message); 13 | } 14 | 15 | public FileNotFoundException(String message, Throwable cause) { 16 | super(message, cause); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/src/main/java/net/javaguides/springboot/fileuploaddownload/exception/FileStorageException.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload.exception; 2 | 3 | public class FileStorageException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public FileStorageException(String message) { 8 | super(message); 9 | } 10 | 11 | public FileStorageException(String message, Throwable cause) { 12 | super(message, cause); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/src/main/java/net/javaguides/springboot/fileuploaddownload/property/FileStorageProperties.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload.property; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | @ConfigurationProperties(prefix = "file") 8 | public class FileStorageProperties { 9 | private String uploadDir; 10 | 11 | public String getUploadDir() { 12 | return uploadDir; 13 | } 14 | 15 | public void setUploadDir(String uploadDir) { 16 | this.uploadDir = uploadDir; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## MULTIPART (MultipartProperties) 2 | # Enable multipart uploads 3 | spring.servlet.multipart.enabled=true 4 | # Threshold after which files are written to disk. 5 | spring.servlet.multipart.file-size-threshold=2KB 6 | # Max file size. 7 | spring.servlet.multipart.max-file-size=200MB 8 | # Max Request Size 9 | spring.servlet.multipart.max-request-size=215MB 10 | 11 | ## File Storage Properties 12 | file.upload-dir=./uploads 13 | 14 | server.port=8081 -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/src/test/java/net/javaguides/springboot/fileuploaddownload/SpringbootUploadDownloadFileApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.fileuploaddownload; 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 SpringbootUploadDownloadFileApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/uploads/new-junior-born.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-upload-download-file-rest-api-example/uploads/new-junior-born.png -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/uploads/project-structure.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-upload-download-file-rest-api-example/uploads/project-structure.PNG -------------------------------------------------------------------------------- /springboot-upload-download-file-rest-api-example/uploads/spring-web-annotations.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot-upload-download-file-rest-api-example/uploads/spring-web-annotations.PNG -------------------------------------------------------------------------------- /springboot2-annotation-config/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-annotation-config/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-annotation-config/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-annotation-config/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-annotation-config/src/main/java/net/guides/springboot2/springboot2annotationconfig/service/EmailService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2annotationconfig.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service("EmailService") 6 | public class EmailService implements MessageService{ 7 | 8 | public void sendMsg(String message) { 9 | System.out.println(message); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot2-annotation-config/src/main/java/net/guides/springboot2/springboot2annotationconfig/service/MessageService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2annotationconfig.service; 2 | 3 | public interface MessageService { 4 | public void sendMsg(String message); 5 | } 6 | -------------------------------------------------------------------------------- /springboot2-annotation-config/src/main/java/net/guides/springboot2/springboot2annotationconfig/service/SMSService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2annotationconfig.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service("SMSService") 6 | public class SMSService implements MessageService{ 7 | 8 | public void sendMsg(String message) { 9 | System.out.println(message); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot2-annotation-config/src/main/java/net/guides/springboot2/springboot2annotationconfig/service/TwitterService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2annotationconfig.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service("TwitterService") 6 | public class TwitterService implements MessageService{ 7 | 8 | public void sendMsg(String message) { 9 | System.out.println(message); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot2-annotation-config/src/main/java/net/guides/springboot2/springboot2annotationconfig/service/UserService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2annotationconfig.service; 2 | 3 | public interface UserService { 4 | public void processMsg(String message); 5 | } 6 | -------------------------------------------------------------------------------- /springboot2-annotation-config/src/main/java/net/guides/springboot2/springboot2annotationconfig/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2annotationconfig.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | import org.springframework.stereotype.Service; 6 | 7 | @Service 8 | public class UserServiceImpl implements UserService { 9 | 10 | @Autowired 11 | @Qualifier("TwitterService") 12 | private MessageService messageService; 13 | 14 | public void setMessageService(MessageService messageService) { 15 | this.messageService = messageService; 16 | } 17 | 18 | public void processMsg(String message) { 19 | messageService.sendMsg(message); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot2-annotation-config/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-annotation-config/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot2-annotation-config/src/test/java/net/guides/springboot2/springboot2annotationconfig/Springboot2AnnotationConfigApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2annotationconfig; 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 Springboot2AnnotationConfigApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-externalizing-conf-properties/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-externalizing-conf-properties/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-externalizing-conf-properties/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-externalizing-conf-properties/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-externalizing-conf-properties/src/main/java/net/guides/springboot2/springboot2externalizingconfproperties/Application.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2externalizingconfproperties; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot2-externalizing-conf-properties/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.web=INFO 2 | logging.level.org.hibernate=ERROR 3 | logging.level.net.guides=DEBUG 4 | 5 | logging.file=myapp.log 6 | 7 | jdbc.driver=com.mysql.jdbc.Driver 8 | jdbc.url=jdbc:mysql://localhost:3306/dev_db 9 | jdbc.username=root 10 | jdbc.password=root -------------------------------------------------------------------------------- /springboot2-externalizing-conf-properties/src/test/java/net/guides/springboot2/springboot2externalizingconfproperties/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2externalizingconfproperties; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-freemarker-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-freemarker-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-freemarker-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-freemarker-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-freemarker-example/src/main/java/net/guides/springboot2/freemarker/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.freemarker.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot2.freemarker.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot2-freemarker-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.freemarker.template-loader-path: classpath:/templates 2 | spring.freemarker.suffix: .ftl -------------------------------------------------------------------------------- /springboot2-freemarker-example/src/main/resources/templates/index.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Home page 5 | 6 | 7 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |

Home Page

17 |
18 | Show Employees (Retrieve employee data from database) 19 |
20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /springboot2-java-config/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-java-config/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-java-config/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-java-config/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-java-config/src/main/java/net/guides/springboot2/springboot2javaconfig/service/EmailService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2javaconfig.service; 2 | 3 | public class EmailService implements MessageService{ 4 | 5 | public void sendMsg(String message) { 6 | System.out.println(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot2-java-config/src/main/java/net/guides/springboot2/springboot2javaconfig/service/MessageProcessor.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2javaconfig.service; 2 | 3 | public interface MessageProcessor { 4 | public void processMsg(String message); 5 | } 6 | -------------------------------------------------------------------------------- /springboot2-java-config/src/main/java/net/guides/springboot2/springboot2javaconfig/service/MessageProcessorImpl.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2javaconfig.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | 6 | public class MessageProcessorImpl implements MessageProcessor { 7 | 8 | private MessageService messageService; 9 | 10 | @Autowired 11 | public MessageProcessorImpl(@Qualifier("TwitterService") MessageService messageService) { 12 | this.messageService = messageService; 13 | } 14 | 15 | public void processMsg(String message) { 16 | messageService.sendMsg(message); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /springboot2-java-config/src/main/java/net/guides/springboot2/springboot2javaconfig/service/MessageService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2javaconfig.service; 2 | 3 | public interface MessageService { 4 | public void sendMsg(String message); 5 | } 6 | -------------------------------------------------------------------------------- /springboot2-java-config/src/main/java/net/guides/springboot2/springboot2javaconfig/service/SMSService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2javaconfig.service; 2 | 3 | public class SMSService implements MessageService{ 4 | 5 | public void sendMsg(String message) { 6 | System.out.println(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot2-java-config/src/main/java/net/guides/springboot2/springboot2javaconfig/service/TwitterService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2javaconfig.service; 2 | 3 | public class TwitterService implements MessageService{ 4 | 5 | public void sendMsg(String message) { 6 | System.out.println(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot2-java-config/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-java-config/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot2-java-config/src/test/java/net/guides/springboot2/springboot2javaconfig/Springboot2JavaConfigApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2javaconfig; 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 Springboot2JavaConfigApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-jdbc-crud-mysql-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-jdbc-crud-mysql-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-jdbc-crud-mysql-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-jdbc-crud-mysql-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-jdbc-crud-mysql-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url = jdbc:mysql://localhost:3306/demo?useSSL=false 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | 6 | 7 | ## Hibernate Properties 8 | #The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update 13 | 14 | logging.level.org.hibernate.stat=debug 15 | # Show all queries 16 | spring.jpa.show-sql=true 17 | spring.jpa.properties.hibernate.format_sql=true 18 | logging.level.org.hibernate.type=trace -------------------------------------------------------------------------------- /springboot2-jdbc-crud-mysql-example/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | insert into employees values(10001,'Ramesh', 'Fadatare', 'ramesh@gmail.com'); 2 | 3 | insert into employees values(10002,'Jit', 'Jadhav', 'jadhav@gmail.com'); -------------------------------------------------------------------------------- /springboot2-jdbc-crud-mysql-example/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | create table employees 2 | ( 3 | id integer not null, 4 | first_name varchar(255) not null, 5 | last_name varchar(255) not null, 6 | email_address varchar(255) not null, 7 | primary key(id) 8 | ); -------------------------------------------------------------------------------- /springboot2-jdbc-crud-mysql-example/src/test/java/net/guides/springboot2/springboot2jpacrudexample/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-jms-activemq/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | 12 | ### IntelliJ IDEA ### 13 | .idea 14 | *.iws 15 | *.iml 16 | *.ipr 17 | 18 | ### NetBeans ### 19 | nbproject/private/ 20 | build/ 21 | nbbuild/ 22 | dist/ 23 | nbdist/ 24 | .nb-gradle/ 25 | # Elastic Beanstalk Files 26 | .elasticbeanstalk/* 27 | !.elasticbeanstalk/*.cfg.yml 28 | !.elasticbeanstalk/*.global.yml 29 | -------------------------------------------------------------------------------- /springboot2-jms-activemq/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-jms-activemq/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-jms-activemq/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-jms-activemq/src/main/java/net/javaguides/springboot/jms/ConfirmationReceiver.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.jms; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.jms.annotation.JmsListener; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * Created by Ramesh Fadatare 10 | */ 11 | @Component 12 | public class ConfirmationReceiver { 13 | 14 | private Logger logger = LoggerFactory.getLogger(ConfirmationReceiver.class); 15 | 16 | @JmsListener(destination = "confirmationQueue", containerFactory = "connectionFactory") 17 | public void receiveConfirmation(Confirmation confirmation) { 18 | logger.info(" >> Received confirmation: " + confirmation); 19 | 20 | } 21 | } -------------------------------------------------------------------------------- /springboot2-jms-activemq/src/main/java/net/javaguides/springboot/jms/ConfirmationSender.java: -------------------------------------------------------------------------------- 1 | package net.javaguides.springboot.jms; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.jms.core.JmsTemplate; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * Created by Ramesh Fadatare 9 | */ 10 | @Component 11 | public class ConfirmationSender { 12 | 13 | @Autowired 14 | JmsTemplate jmsTemplate; 15 | 16 | public void sendMessage(final Confirmation confirmation) { 17 | jmsTemplate.convertAndSend("confirmationQueue", confirmation); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /springboot2-jms-activemq/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /springboot2-jpa-auditing/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-jpa-auditing/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-jpa-auditing/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-jpa-auditing/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-jpa-auditing/src/main/java/net/guides/springboot/springboot2jpaauditing/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springboot2jpaauditing.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot2-jpa-auditing/src/main/java/net/guides/springboot/springboot2jpaauditing/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springboot2jpaauditing.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot.springboot2jpaauditing.model.User; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot2-jpa-auditing/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url = jdbc:mysql://localhost:3306/users_database?useSSL=false 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | 6 | 7 | ## Hibernate Properties 8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update -------------------------------------------------------------------------------- /springboot2-jpa-auditing/src/test/java/net/guides/springboot/springboot2jpaauditing/Springboot2JpaAuditingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot.springboot2jpaauditing; 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 Springboot2JpaAuditingApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-jpa-crud-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/Application.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | public static void main(String[] args) { 9 | SpringApplication.run(Application.class, args); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot2.springboot2jpacrudexample.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url = jdbc:mysql://localhost:3306/users_database?useSSL=false 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | 6 | 7 | ## Hibernate Properties 8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update -------------------------------------------------------------------------------- /springboot2-jpa-crud-example/src/test/java/net/guides/springboot2/springboot2jpacrudexample/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-jpa-h2-crud-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/Application.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.client.RestTemplateBuilder; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.web.client.RestTemplate; 8 | 9 | @SpringBootApplication 10 | public class Application { 11 | 12 | @Bean 13 | public RestTemplate restTemplate(RestTemplateBuilder builder) { 14 | return builder.build(); 15 | } 16 | 17 | public static void main(String[] args) { 18 | SpringApplication.run(Application.class, args); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot2.springboot2jpacrudexample.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-jpa-h2-crud-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot2-jpa-h2-crud-example/src/test/java/net/guides/springboot2/springboot2jpacrudexample/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-jpa-swagger2/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/src/main/java/net/guides/springboot2/springboot2swagger2/Springboot2Swagger2Application.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2swagger2; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot2Swagger2Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot2Swagger2Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/src/main/java/net/guides/springboot2/springboot2swagger2/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2swagger2.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/src/main/java/net/guides/springboot2/springboot2swagger2/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2swagger2.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/src/main/java/net/guides/springboot2/springboot2swagger2/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2swagger2.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot2.springboot2swagger2.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url = jdbc:mysql://localhost:3306/users_database?useSSL=false 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | 6 | 7 | ## Hibernate Properties 8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update 13 | 14 | logging.level.root = DEBUG -------------------------------------------------------------------------------- /springboot2-jpa-swagger2/src/test/java/net/guides/springboot2/springboot2jpaswagger2/Springboot2Swagger2ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpaswagger2; 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 Springboot2Swagger2ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-junit5-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-junit5-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-junit5-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-junit5-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-junit5-example/src/main/java/net/guides/springboot2/springboot2junit5example/Springboot2Junit5ExampleApplication.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2junit5example; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot2Junit5ExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot2Junit5ExampleApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot2-junit5-example/src/main/java/net/guides/springboot2/springboot2junit5example/controller/MessageController.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2junit5example.controller; 2 | import org.springframework.web.bind.annotation.GetMapping; 3 | import org.springframework.web.bind.annotation.RestController; 4 | 5 | @RestController 6 | public class MessageController { 7 | 8 | @GetMapping("/hello") 9 | public String hello() { 10 | return "Hello World"; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /springboot2-junit5-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-junit5-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot2-logging/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-logging/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-logging/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-logging/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-logging/src/main/java/net/guides/springboot2/springboot2logging/Article.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2logging; 2 | 3 | public class Article { 4 | private int id; 5 | private String name; 6 | 7 | 8 | public Article(int id, String name) { 9 | super(); 10 | this.id = id; 11 | this.name = name; 12 | } 13 | 14 | public int getId() { 15 | return id; 16 | } 17 | public void setId(int id) { 18 | this.id = id; 19 | } 20 | public String getName() { 21 | return name; 22 | } 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /springboot2-logging/src/main/java/net/guides/springboot2/springboot2logging/ArticleController.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2logging; 2 | 3 | import java.util.List; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | @RestController 12 | public class ArticleController { 13 | private static final Logger logger = LoggerFactory.getLogger(ArticleService.class); 14 | @Autowired 15 | private ArticleService articleService; 16 | @GetMapping("/hello") 17 | public List
getArticles() { 18 | logger.debug("inside ArticleController.getArticles() method"); 19 | return articleService.getArticles(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot2-logging/src/main/java/net/guides/springboot2/springboot2logging/ArticleService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2logging; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class ArticleService { 12 | 13 | private static final Logger logger = LoggerFactory.getLogger(ArticleService.class); 14 | public List
getArticles(){ 15 | logger.debug("inside getArticles() method"); 16 | return Arrays.asList(new Article(100, "article"),new Article(200, "article2")); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /springboot2-logging/src/main/java/net/guides/springboot2/springboot2logging/Springboot2LoggingApplication.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2logging; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot2LoggingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot2LoggingApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot2-logging/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.web=INFO 2 | logging.level.org.hibernate=ERROR 3 | logging.level.net.guides=DEBUG 4 | 5 | logging.file=myapp.log 6 | 7 | server.port=8081 8 | 9 | server.servlet.context-path=DemoContextPath -------------------------------------------------------------------------------- /springboot2-logging/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | app.log 10 | 11 | %date %level [%thread] %logger{10} [%file:%line] %msg%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /springboot2-logging/src/test/java/net/guides/springboot2/springboot2logging/Springboot2LoggingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2logging; 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 Springboot2LoggingApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-mybatis-mysql-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-mybatis-mysql-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-mybatis-mysql-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-mybatis-mysql-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-mybatis-mysql-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) 2 | spring.datasource.url = jdbc:mysql://localhost:3306/demo?useSSL=false 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | 6 | 7 | ## Hibernate Properties 8 | #The SQL dialect makes Hibernate generate better SQL for the chosen database 9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect 10 | 11 | # Hibernate ddl auto (create, create-drop, validate, update) 12 | spring.jpa.hibernate.ddl-auto = update 13 | 14 | logging.level.org.hibernate.stat=debug 15 | # Show all queries 16 | spring.jpa.show-sql=true 17 | spring.jpa.properties.hibernate.format_sql=true 18 | logging.level.org.hibernate.type=trace -------------------------------------------------------------------------------- /springboot2-mybatis-mysql-example/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | insert into employees values(10001,'Ramesh', 'Fadatare', 'ramesh@gmail.com'); 2 | 3 | insert into employees values(10002,'Jit', 'Jadhav', 'jadhav@gmail.com'); -------------------------------------------------------------------------------- /springboot2-mybatis-mysql-example/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | create table employees 2 | ( 3 | id integer not null, 4 | first_name varchar(255) not null, 5 | last_name varchar(255) not null, 6 | email_address varchar(255) not null, 7 | primary key(id) 8 | ); -------------------------------------------------------------------------------- /springboot2-mybatis-mysql-example/src/test/java/net/guides/springboot2/springboot2jpacrudexample/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-springaop-example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-springaop-example/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-springaop-example/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-springaop-example/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-springaop-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/Application.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.client.RestTemplateBuilder; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.web.client.RestTemplate; 8 | 9 | @SpringBootApplication 10 | public class Application { 11 | 12 | @Bean 13 | public RestTemplate restTemplate(RestTemplateBuilder builder) { 14 | return builder.build(); 15 | } 16 | 17 | public static void main(String[] args) { 18 | SpringApplication.run(Application.class, args); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /springboot2-springaop-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/exception/ErrorDetails.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.exception; 2 | 3 | import java.util.Date; 4 | 5 | public class ErrorDetails { 6 | private Date timestamp; 7 | private String message; 8 | private String details; 9 | 10 | public ErrorDetails(Date timestamp, String message, String details) { 11 | super(); 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | this.details = details; 15 | } 16 | 17 | public Date getTimestamp() { 18 | return timestamp; 19 | } 20 | 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | public String getDetails() { 26 | return details; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot2-springaop-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends Exception{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message){ 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot2-springaop-example/src/main/java/net/guides/springboot2/springboot2jpacrudexample/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import net.guides.springboot2.springboot2jpacrudexample.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot2-springaop-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.web=INFO 2 | logging.level.org.hibernate=ERROR 3 | logging.level.net.guides=DEBUG -------------------------------------------------------------------------------- /springboot2-springaop-example/src/test/java/net/guides/springboot2/springboot2jpacrudexample/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2jpacrudexample; 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 ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp-WAR/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-webapp-jsp-WAR/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-webapp-jsp-WAR/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-webapp-jsp-WAR/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp-WAR/src/main/java/net/guides/springboot2/springboot2webappjsp/controllers/UserController.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp.controllers; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import net.guides.springboot2.springboot2webappjsp.repositories.UserRepository; 9 | 10 | @Controller 11 | public class UserController { 12 | @Autowired 13 | UserRepository userRepo; 14 | 15 | @RequestMapping("/users") 16 | public String home(Model model) { 17 | model.addAttribute("users", userRepo.findAll()); 18 | return "users"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp-WAR/src/main/java/net/guides/springboot2/springboot2webappjsp/domain/User.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp.domain; 2 | 3 | import jakarta.persistence.*; 4 | 5 | @Entity 6 | @Table(name = "user") 7 | public class User 8 | { 9 | @Id 10 | @GeneratedValue(strategy=GenerationType.AUTO) 11 | private Integer id; 12 | private String name; 13 | 14 | public User() 15 | { 16 | } 17 | 18 | public User(Integer id, String name) 19 | { 20 | this.id = id; 21 | this.name = name; 22 | } 23 | 24 | public Integer getId() 25 | { 26 | return id; 27 | } 28 | 29 | public void setId(Integer id) 30 | { 31 | this.id = id; 32 | } 33 | 34 | public String getName() 35 | { 36 | return name; 37 | } 38 | 39 | public void setName(String name) 40 | { 41 | this.name = name; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp-WAR/src/main/java/net/guides/springboot2/springboot2webappjsp/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp.repositories; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import net.guides.springboot2.springboot2webappjsp.domain.User; 6 | 7 | public interface UserRepository extends JpaRepository 8 | { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp-WAR/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.view.prefix: /WEB-INF/jsp/ 2 | spring.mvc.view.suffix: .jsp 3 | 4 | logging.level.org.springframework=INFO 5 | 6 | ################### DataSource Configuration ########################## 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 8 | spring.datasource.url=jdbc:mysql://localhost:3306/users_database 9 | spring.datasource.username=root 10 | spring.datasource.password=root 11 | 12 | ################### Hibernate Configuration ########################## 13 | 14 | spring.jpa.hibernate.ddl-auto=update 15 | spring.jpa.show-sql=true 16 | 17 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp-WAR/src/test/java/net/guides/springboot2/springboot2webappjsp/Springboot2WebappJspApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp; 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 Springboot2WebappJspApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-webapp-jsp/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-webapp-jsp/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-webapp-jsp/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp/src/main/java/net/guides/springboot2/springboot2webappjsp/Springboot2WebappJspApplication.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp; 2 | 3 | import java.util.Collections; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | 8 | @SpringBootApplication 9 | public class Springboot2WebappJspApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication app = new SpringApplication(Springboot2WebappJspApplication.class); 13 | app.setDefaultProperties(Collections.singletonMap("server.servlet.context-path", "/springboot2webapp")); 14 | app.run(args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp/src/main/java/net/guides/springboot2/springboot2webappjsp/controllers/UserController.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp.controllers; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import net.guides.springboot2.springboot2webappjsp.repositories.UserRepository; 9 | 10 | @Controller 11 | public class UserController { 12 | @Autowired 13 | UserRepository userRepo; 14 | 15 | @RequestMapping("/users") 16 | public String home(Model model) { 17 | model.addAttribute("users", userRepo.findAll()); 18 | return "users"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp/src/main/java/net/guides/springboot2/springboot2webappjsp/domain/User.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp.domain; 2 | 3 | import jakarta.persistence.*; 4 | 5 | @Entity 6 | @Table(name = "user") 7 | public class User 8 | { 9 | @Id 10 | @GeneratedValue(strategy=GenerationType.AUTO) 11 | private Integer id; 12 | private String name; 13 | 14 | public User() 15 | { 16 | } 17 | 18 | public User(Integer id, String name) 19 | { 20 | this.id = id; 21 | this.name = name; 22 | } 23 | 24 | public Integer getId() 25 | { 26 | return id; 27 | } 28 | 29 | public void setId(Integer id) 30 | { 31 | this.id = id; 32 | } 33 | 34 | public String getName() 35 | { 36 | return name; 37 | } 38 | 39 | public void setName(String name) 40 | { 41 | this.name = name; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp/src/main/java/net/guides/springboot2/springboot2webappjsp/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp.repositories; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import net.guides.springboot2.springboot2webappjsp.domain.User; 6 | 7 | public interface UserRepository extends JpaRepository 8 | { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.view.prefix: /WEB-INF/jsp/ 2 | spring.mvc.view.suffix: .jsp 3 | 4 | logging.level.org.springframework=INFO 5 | 6 | ################### DataSource Configuration ########################## 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 8 | spring.datasource.url=jdbc:mysql://localhost:3306/users_database 9 | spring.datasource.username=root 10 | spring.datasource.password=root 11 | 12 | ################### Hibernate Configuration ########################## 13 | 14 | spring.jpa.hibernate.ddl-auto=update 15 | spring.jpa.show-sql=true 16 | 17 | -------------------------------------------------------------------------------- /springboot2-webapp-jsp/src/test/java/net/guides/springboot2/springboot2webappjsp/Springboot2WebappJspApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappjsp; 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 Springboot2WebappJspApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-webapp-thymeleaf/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/java/net/guides/springboot2/springboot2webappthymeleaf/Springboot2WebappThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappthymeleaf; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springboot2WebappThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springboot2WebappThymeleafApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/java/net/guides/springboot2/springboot2webappthymeleaf/controllers/HomeController.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappthymeleaf.controllers; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import net.guides.springboot2.springboot2webappthymeleaf.repositories.UserRepository; 9 | 10 | @Controller 11 | public class HomeController 12 | { 13 | @Autowired UserRepository userRepo; 14 | 15 | @RequestMapping("/") 16 | public String home(Model model) 17 | { 18 | model.addAttribute("users", userRepo.findAll()); 19 | return "index"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/java/net/guides/springboot2/springboot2webappthymeleaf/domain/User.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappthymeleaf.domain; 2 | 3 | import jakarta.persistence.*; 4 | 5 | @Entity 6 | @Table(name = "user") 7 | public class User 8 | { 9 | @Id 10 | @GeneratedValue(strategy=GenerationType.AUTO) 11 | private Integer id; 12 | private String name; 13 | 14 | public User() 15 | { 16 | } 17 | 18 | public User(Integer id, String name) 19 | { 20 | this.id = id; 21 | this.name = name; 22 | } 23 | 24 | public Integer getId() 25 | { 26 | return id; 27 | } 28 | 29 | public void setId(Integer id) 30 | { 31 | this.id = id; 32 | } 33 | 34 | public String getName() 35 | { 36 | return name; 37 | } 38 | 39 | public void setName(String name) 40 | { 41 | this.name = name; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/java/net/guides/springboot2/springboot2webappthymeleaf/repositories/UserRepository.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappthymeleaf.repositories; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import net.guides.springboot2.springboot2webappthymeleaf.domain.User; 6 | 7 | public interface UserRepository extends JpaRepository 8 | { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | 2 | logging.level.org.springframework=INFO 3 | 4 | ################### DataSource Configuration ########################## 5 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 6 | spring.datasource.url=jdbc:mysql://localhost:3306/test 7 | spring.datasource.username=root 8 | spring.datasource.password=admin 9 | 10 | spring.datasource.initialize=true 11 | 12 | ################### Hibernate Configuration ########################## 13 | 14 | spring.jpa.hibernate.ddl-auto=update 15 | spring.jpa.show-sql=true 16 | 17 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | logging.level.org.springframework=INFO 3 | 4 | ################### DataSource Configuration ########################## 5 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 6 | spring.datasource.url=jdbc:mysql://localhost:3306/users_database 7 | spring.datasource.username=root 8 | spring.datasource.password=root 9 | 10 | ################### Hibernate Configuration ########################## 11 | 12 | spring.jpa.hibernate.ddl-auto=update 13 | spring.jpa.show-sql=true 14 | 15 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | delete from user; 2 | 3 | INSERT INTO `users_database`.`user` (`id`, `name`) VALUES ('1', 'Salman'); 4 | INSERT INTO `users_database`.`user` (`id`, `name`) VALUES ('2', 'SRK'); 5 | INSERT INTO `users_database`.`user` (`id`, `name`) VALUES ('3', 'AMIR'); 6 | INSERT INTO `users_database`.`user` (`id`, `name`) VALUES ('4', 'Tiger'); 7 | INSERT INTO `users_database`.`user` (`id`, `name`) VALUES ('5', 'Prabhas'); 8 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | app.title=SpringMVC JPA Demo (With SpringBoot) -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Home 7 | 8 | 9 |

App Title

10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
IdName
IdName
24 | 25 | -------------------------------------------------------------------------------- /springboot2-webapp-thymeleaf/src/test/java/net/guides/springboot2/springboot2webappthymeleaf/Springboot2WebappThymeleafApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2webappthymeleaf; 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 Springboot2WebappThymeleafApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /springboot2-xml-config/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot2-xml-config/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-xml-config/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot2-xml-config/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /springboot2-xml-config/src/main/java/net/guides/springboot2/springboot2xmlconfig/model/Message.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2xmlconfig.model; 2 | 3 | public class Message { 4 | private int id; 5 | private String message; 6 | public Message(int id, String message) { 7 | super(); 8 | this.id = id; 9 | this.message = message; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /springboot2-xml-config/src/main/java/net/guides/springboot2/springboot2xmlconfig/service/EmailService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2xmlconfig.service; 2 | 3 | public class EmailService implements MessageService{ 4 | 5 | public void sendMsg(String message) { 6 | System.out.println(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot2-xml-config/src/main/java/net/guides/springboot2/springboot2xmlconfig/service/MessageProcessor.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2xmlconfig.service; 2 | 3 | public interface MessageProcessor { 4 | public void processMsg(String message); 5 | } 6 | -------------------------------------------------------------------------------- /springboot2-xml-config/src/main/java/net/guides/springboot2/springboot2xmlconfig/service/MessageProcessorImpl.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2xmlconfig.service; 2 | 3 | public class MessageProcessorImpl implements MessageProcessor { 4 | 5 | private MessageService messageService; 6 | 7 | public void setMessageService(MessageService messageService) { 8 | this.messageService = messageService; 9 | } 10 | 11 | public void processMsg(String message) { 12 | messageService.sendMsg(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot2-xml-config/src/main/java/net/guides/springboot2/springboot2xmlconfig/service/MessageService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2xmlconfig.service; 2 | 3 | public interface MessageService { 4 | public void sendMsg(String message); 5 | } 6 | -------------------------------------------------------------------------------- /springboot2-xml-config/src/main/java/net/guides/springboot2/springboot2xmlconfig/service/SMSService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2xmlconfig.service; 2 | 3 | public class SMSService implements MessageService{ 4 | 5 | public void sendMsg(String message) { 6 | System.out.println(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot2-xml-config/src/main/java/net/guides/springboot2/springboot2xmlconfig/service/TwitterService.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2xmlconfig.service; 2 | 3 | public class TwitterService implements MessageService{ 4 | 5 | public void sendMsg(String message) { 6 | System.out.println(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot2-xml-config/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RameshMF/spring-boot-tutorial/9cdb898b9ba819d8039314314390d2fb4774b0cf/springboot2-xml-config/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot2-xml-config/src/test/java/net/guides/springboot2/springboot2xmlconfig/Springboot2XmlConfigApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.guides.springboot2.springboot2xmlconfig; 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 Springboot2XmlConfigApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | --------------------------------------------------------------------------------