+ Upload new Video
+
+
diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/photos.html b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/photos.html
new file mode 100644
index 0000000000..b5d56d020a
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/photos.html
@@ -0,0 +1,10 @@
+
+
+
View Photo
+ Title: name
+
+
+
+ Back to home page
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/uploadPhoto.html b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/uploadPhoto.html
new file mode 100644
index 0000000000..6d51c06d8f
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/uploadPhoto.html
@@ -0,0 +1,15 @@
+
+
+
+
Upload new Photo
+
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/uploadVideo.html b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/uploadVideo.html
new file mode 100644
index 0000000000..ebc29d98e2
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/uploadVideo.html
@@ -0,0 +1,15 @@
+
+
+
+
Upload new Video
+
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/videos.html b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/videos.html
new file mode 100644
index 0000000000..b0ee0fc577
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/templates/videos.html
@@ -0,0 +1,15 @@
+
+
+
View Video
+ Title: title
+
+
+
+
+
+
+ Back to home page
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-data-jpa-2/pom.xml b/persistence-modules/spring-data-jpa-2/pom.xml
index fbc19810ef..08be64670b 100644
--- a/persistence-modules/spring-data-jpa-2/pom.xml
+++ b/persistence-modules/spring-data-jpa-2/pom.xml
@@ -29,7 +29,7 @@
net.ttddyydatasource-proxy
- 1.4.1
+ ${datasource-proxy.version}
@@ -42,4 +42,8 @@
spring-oxm
+
+
+ 1.4.1
+
\ No newline at end of file
diff --git a/persistence-modules/spring-data-jpa/pom.xml b/persistence-modules/spring-data-jpa/pom.xml
index a7788065c9..af92f331d1 100644
--- a/persistence-modules/spring-data-jpa/pom.xml
+++ b/persistence-modules/spring-data-jpa/pom.xml
@@ -37,14 +37,14 @@
org.testcontainerspostgresql
- 1.10.6
+ ${testcontainers.postgresql.version}testorg.postgresqlpostgresql
- 42.2.5
+ ${postgresql.version}
@@ -66,7 +66,7 @@
com.google.guavaguava
- 21.0
+ ${guava.version}
@@ -92,6 +92,9 @@
com.baeldung.boot.Application
+ 1.10.6
+ 42.2.5
+ 21.0
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index d67622feb7..b4fed5150d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -506,6 +506,7 @@
libraries-primitivelibraries-securitylibraries-server
+ libraries-httplinkrestlogging-moduleslombok
@@ -1185,6 +1186,7 @@
libraries-apache-commonslibraries-securitylibraries-server
+ libraries-httplinkrestlogging-moduleslombok
@@ -1552,6 +1554,7 @@
1.6.02.21.02.5
+ 2.61.43.0.03.1.0
diff --git a/ratpack/README.md b/ratpack/README.md
index 14bc3f6c74..78e2f8ccfc 100644
--- a/ratpack/README.md
+++ b/ratpack/README.md
@@ -6,3 +6,4 @@
- [Ratpack with Hystrix](http://www.baeldung.com/ratpack-hystrix)
- [Ratpack HTTP Client](https://www.baeldung.com/ratpack-http-client)
- [Ratpack with RxJava](https://www.baeldung.com/ratpack-rxjava)
+- [Ratpack with Groovy](https://www.baeldung.com/ratpack-groovy)
diff --git a/spring-5/src/main/java/com/baeldung/components/AccountService.java b/spring-5/src/main/java/com/baeldung/components/AccountService.java
new file mode 100644
index 0000000000..c2f09c735e
--- /dev/null
+++ b/spring-5/src/main/java/com/baeldung/components/AccountService.java
@@ -0,0 +1,8 @@
+package com.baeldung.components;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class AccountService {
+
+}
diff --git a/spring-5/src/main/java/com/baeldung/components/UserService.java b/spring-5/src/main/java/com/baeldung/components/UserService.java
new file mode 100644
index 0000000000..80e5e0c632
--- /dev/null
+++ b/spring-5/src/main/java/com/baeldung/components/UserService.java
@@ -0,0 +1,16 @@
+package com.baeldung.components;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class UserService {
+
+ @Autowired
+ private AccountService accountService;
+
+ public AccountService getAccountService() {
+ return accountService;
+ }
+
+}
diff --git a/spring-5/src/main/resources/beans.xml b/spring-5/src/main/resources/beans.xml
new file mode 100644
index 0000000000..004745b817
--- /dev/null
+++ b/spring-5/src/main/resources/beans.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-5/src/test/java/com/baeldung/SpringXMLConfigurationIntegrationTest.java b/spring-5/src/test/java/com/baeldung/SpringXMLConfigurationIntegrationTest.java
new file mode 100644
index 0000000000..4ecad9c43e
--- /dev/null
+++ b/spring-5/src/test/java/com/baeldung/SpringXMLConfigurationIntegrationTest.java
@@ -0,0 +1,23 @@
+package com.baeldung;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import com.baeldung.components.AccountService;
+import com.baeldung.components.UserService;
+
+public class SpringXMLConfigurationIntegrationTest {
+
+ @Test
+ public void givenContextAnnotationConfigOrContextComponentScan_whenDependenciesAndBeansAnnotated_thenNoXMLNeeded() {
+ ApplicationContext context = new ClassPathXmlApplicationContext("classpath:beans.xml");
+ UserService userService = context.getBean(UserService.class);
+ AccountService accountService = context.getBean(AccountService.class);
+ Assert.assertNotNull(userService);
+ Assert.assertNotNull(accountService);
+ Assert.assertNotNull(userService.getAccountService());
+ }
+
+}
diff --git a/spring-boot-autoconfiguration/README.MD b/spring-boot-autoconfiguration/README.MD
index a71af54dff..dc9cad539a 100644
--- a/spring-boot-autoconfiguration/README.MD
+++ b/spring-boot-autoconfiguration/README.MD
@@ -3,4 +3,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles:
-- [Create a Custom Auto-Configuration with Spring Boot](http://www.baeldung.com/spring-boot-custom-auto-configuration)
\ No newline at end of file
+- [Create a Custom Auto-Configuration with Spring Boot](http://www.baeldung.com/spring-boot-custom-auto-configuration)
+- [Guide to ApplicationContextRunner in Spring Boot](https://www.baeldung.com/spring-boot-context-runner)
diff --git a/spring-boot-mvc/pom.xml b/spring-boot-mvc/pom.xml
index e17c1d39b9..fee725847f 100644
--- a/spring-boot-mvc/pom.xml
+++ b/spring-boot-mvc/pom.xml
@@ -40,7 +40,7 @@
org.glassfishjavax.faces
- 2.3.7
+ ${javax.faces.version}
@@ -108,6 +108,7 @@
2.9.21.10.0
+ 2.3.7com.baeldung.springbootmvc.SpringBootMvcApplication
diff --git a/spring-boot-parent/README.md b/spring-boot-parent/README.md
new file mode 100644
index 0000000000..c3bb4c700d
--- /dev/null
+++ b/spring-boot-parent/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles
+
+- [The Spring Boot Starter Parent](https://www.baeldung.com/spring-boot-starter-parent)
diff --git a/spring-boot-performance/README.md b/spring-boot-performance/README.md
new file mode 100644
index 0000000000..015dd759a8
--- /dev/null
+++ b/spring-boot-performance/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles
+
+- [Lazy Initialization in Spring Boot 2](https://www.baeldung.com/spring-boot-lazy-initialization)
diff --git a/spring-boot/README.MD b/spring-boot/README.MD
index d7af3f4614..435398904f 100644
--- a/spring-boot/README.MD
+++ b/spring-boot/README.MD
@@ -37,3 +37,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Validation in Spring Boot](https://www.baeldung.com/spring-boot-bean-validation)
- [Guide to Creating and Running a Jar File in Java](https://www.baeldung.com/java-create-jar)
- [Entity To DTO Conversion for a Spring REST API](https://www.baeldung.com/entity-to-and-from-dto-for-a-java-spring-application)
+- [Guide to @EnableConfigurationProperties](https://www.baeldung.com/spring-enable-config-properties)
diff --git a/spring-boot/src/main/java/com/baeldung/properties/conversion/Employee.java b/spring-boot/src/main/java/com/baeldung/properties/conversion/Employee.java
new file mode 100644
index 0000000000..52c7881dfc
--- /dev/null
+++ b/spring-boot/src/main/java/com/baeldung/properties/conversion/Employee.java
@@ -0,0 +1,30 @@
+package com.baeldung.properties.conversion;
+
+public class Employee {
+
+ private String name;
+ private double salary;
+
+ public Employee(String name, double salary) {
+ super();
+ this.name = name;
+ this.salary = salary;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public double getSalary() {
+ return salary;
+ }
+
+ public void setSalary(double salary) {
+ this.salary = salary;
+ }
+
+}
diff --git a/spring-boot/src/main/java/com/baeldung/properties/conversion/EmployeeConverter.java b/spring-boot/src/main/java/com/baeldung/properties/conversion/EmployeeConverter.java
new file mode 100644
index 0000000000..6ec19cae72
--- /dev/null
+++ b/spring-boot/src/main/java/com/baeldung/properties/conversion/EmployeeConverter.java
@@ -0,0 +1,16 @@
+package com.baeldung.properties.conversion;
+
+import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
+import org.springframework.core.convert.converter.Converter;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationPropertiesBinding
+public class EmployeeConverter implements Converter {
+
+ @Override
+ public Employee convert(String from) {
+ String[] data = from.split(",");
+ return new Employee(data[0], Double.parseDouble(data[1]));
+ }
+}
diff --git a/spring-boot/src/main/java/com/baeldung/properties/conversion/PropertiesConversionApplication.java b/spring-boot/src/main/java/com/baeldung/properties/conversion/PropertiesConversionApplication.java
new file mode 100644
index 0000000000..f00a26e9c4
--- /dev/null
+++ b/spring-boot/src/main/java/com/baeldung/properties/conversion/PropertiesConversionApplication.java
@@ -0,0 +1,14 @@
+package com.baeldung.properties.conversion;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackageClasses = { PropertyConversion.class, EmployeeConverter.class })
+public class PropertiesConversionApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(PropertiesConversionApplication.class, args);
+ }
+
+}
diff --git a/spring-boot/src/main/java/com/baeldung/properties/conversion/PropertyConversion.java b/spring-boot/src/main/java/com/baeldung/properties/conversion/PropertyConversion.java
new file mode 100644
index 0000000000..b9c890306f
--- /dev/null
+++ b/spring-boot/src/main/java/com/baeldung/properties/conversion/PropertyConversion.java
@@ -0,0 +1,92 @@
+package com.baeldung.properties.conversion;
+
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.convert.DataSizeUnit;
+import org.springframework.boot.convert.DurationUnit;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.util.unit.DataSize;
+import org.springframework.util.unit.DataUnit;
+
+@Configuration
+@PropertySource("classpath:conversion.properties")
+@ConfigurationProperties(prefix = "conversion")
+public class PropertyConversion {
+ private Duration timeInDefaultUnit;
+
+ private Duration timeInNano;
+
+ @DurationUnit(ChronoUnit.DAYS)
+ private Duration timeInDays;
+
+ private DataSize sizeInDefaultUnit;
+
+ private DataSize sizeInGB;
+
+ @DataSizeUnit(DataUnit.TERABYTES)
+ private DataSize sizeInTB;
+
+ private Employee employee;
+
+ // Getters and setters
+
+ public Duration getTimeInDefaultUnit() {
+ return timeInDefaultUnit;
+ }
+
+ public void setTimeInDefaultUnit(Duration timeInDefaultUnit) {
+ this.timeInDefaultUnit = timeInDefaultUnit;
+ }
+
+ public Duration getTimeInNano() {
+ return timeInNano;
+ }
+
+ public void setTimeInNano(Duration timeInNano) {
+ this.timeInNano = timeInNano;
+ }
+
+ public Duration getTimeInDays() {
+ return timeInDays;
+ }
+
+ public void setTimeInDays(Duration timeInDays) {
+ this.timeInDays = timeInDays;
+ }
+
+ public DataSize getSizeInDefaultUnit() {
+ return sizeInDefaultUnit;
+ }
+
+ public void setSizeInDefaultUnit(DataSize sizeInDefaultUnit) {
+ this.sizeInDefaultUnit = sizeInDefaultUnit;
+ }
+
+ public DataSize getSizeInGB() {
+ return sizeInGB;
+ }
+
+ public void setSizeInGB(DataSize sizeInGB) {
+ this.sizeInGB = sizeInGB;
+ }
+
+ public DataSize getSizeInTB() {
+ return sizeInTB;
+ }
+
+ public void setSizeInTB(DataSize sizeInTB) {
+ this.sizeInTB = sizeInTB;
+ }
+
+ public Employee getEmployee() {
+ return employee;
+ }
+
+ public void setEmployee(Employee employee) {
+ this.employee = employee;
+ }
+
+}
diff --git a/spring-boot/src/test/java/com/baeldung/properties/conversion/PropertiesConversionIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/properties/conversion/PropertiesConversionIntegrationTest.java
new file mode 100644
index 0000000000..53bad329ea
--- /dev/null
+++ b/spring-boot/src/test/java/com/baeldung/properties/conversion/PropertiesConversionIntegrationTest.java
@@ -0,0 +1,46 @@
+package com.baeldung.properties.conversion;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.time.Duration;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.util.unit.DataSize;
+
+import com.baeldung.properties.conversion.PropertiesConversionApplication;
+import com.baeldung.properties.conversion.PropertyConversion;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = PropertiesConversionApplication.class)
+@TestPropertySource("classpath:conversion.properties")
+public class PropertiesConversionIntegrationTest {
+
+ @Autowired
+ private PropertyConversion properties;
+
+ @Test
+ public void whenUseTimeUnitPropertyConversion_thenSuccess() throws Exception {
+ assertEquals(Duration.ofMillis(10), properties.getTimeInDefaultUnit());
+ assertEquals(Duration.ofNanos(9), properties.getTimeInNano());
+ assertEquals(Duration.ofDays(2), properties.getTimeInDays());
+ }
+
+ @Test
+ public void whenUseDataSizePropertyConversion_thenSuccess() throws Exception {
+ assertEquals(DataSize.ofBytes(300), properties.getSizeInDefaultUnit());
+ assertEquals(DataSize.ofGigabytes(2), properties.getSizeInGB());
+ assertEquals(DataSize.ofTerabytes(4), properties.getSizeInTB());
+ }
+
+ @Test
+ public void whenUseCustomPropertyConverter_thenSuccess() throws Exception {
+ assertEquals("john", properties.getEmployee().getName());
+ assertEquals(2000.0, properties.getEmployee().getSalary());
+ }
+
+}
diff --git a/spring-boot/src/test/resources/conversion.properties b/spring-boot/src/test/resources/conversion.properties
new file mode 100644
index 0000000000..640442ec33
--- /dev/null
+++ b/spring-boot/src/test/resources/conversion.properties
@@ -0,0 +1,11 @@
+###### time unit
+conversion.timeInDefaultUnit=10
+conversion.timeInNano=9ns
+conversion.timeInDays=2
+
+###### data size
+conversion.sizeInDefaultUnit=300
+conversion.sizeInGB=2GB
+conversion.sizeInTB=4
+
+conversion.employee=john,2000
\ No newline at end of file
diff --git a/spring-cloud/spring-cloud-functions/pom.xml b/spring-cloud/spring-cloud-functions/pom.xml
index 7a44e4ae0f..82147cea28 100644
--- a/spring-cloud/spring-cloud-functions/pom.xml
+++ b/spring-cloud/spring-cloud-functions/pom.xml
@@ -29,7 +29,7 @@
org.springframework.cloudspring-cloud-starter-function-web
- 1.0.1.RELEASE
+ ${spring-cloud-function.version}com.amazonaws
@@ -40,7 +40,7 @@
com.amazonawsaws-lambda-java-core
- 1.1.0
+ ${aws-lambda-java-core.version}provided
@@ -87,6 +87,7 @@
UTF-81.0.1.RELEASE2.0.2
+ 1.1.02.0.4.RELEASE
diff --git a/spring-mvc-xml/pom.xml b/spring-mvc-xml/pom.xml
index 46af321d1b..c978bdd983 100644
--- a/spring-mvc-xml/pom.xml
+++ b/spring-mvc-xml/pom.xml
@@ -82,7 +82,7 @@
org.glassfishjavax.el
- 3.0.1-b08
+ ${javax.el.version}
@@ -131,12 +131,11 @@
6.0.10.Final1.23.1.0
- 2.9.6
+ 3.0.1-b0819.03.5
- 2.52.8.0
diff --git a/spring-rest/README.md b/spring-rest/README.md
index 5d7894cdf8..54b47604d4 100644
--- a/spring-rest/README.md
+++ b/spring-rest/README.md
@@ -6,7 +6,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles:
- [Spring @RequestMapping](http://www.baeldung.com/spring-requestmapping)
- [Returning Custom Status Codes from Spring Controllers](http://www.baeldung.com/spring-mvc-controller-custom-http-status-code)
-- [A Guide to OkHttp](http://www.baeldung.com/guide-to-okhttp)
- [Binary Data Formats in a Spring REST API](http://www.baeldung.com/spring-rest-api-with-binary-data-formats)
- [Guide to UriComponentsBuilder in Spring](http://www.baeldung.com/spring-uricomponentsbuilder)
- [Introduction to FindBugs](http://www.baeldung.com/intro-to-findbugs)
diff --git a/spring-rest/pom.xml b/spring-rest/pom.xml
index 36934af101..99bdd7646d 100644
--- a/spring-rest/pom.xml
+++ b/spring-rest/pom.xml
@@ -93,13 +93,6 @@
commons-lang3
-
-
- com.squareup.okhttp3
- okhttp
- ${com.squareup.okhttp3.version}
-
-
org.hamcrest
@@ -280,8 +273,6 @@
3.0.43.0.0false
-
- 3.4.12.2.03.5.11
diff --git a/spring-resttemplate/README.md b/spring-resttemplate/README.md
index c2c4965231..97a89ff7aa 100644
--- a/spring-resttemplate/README.md
+++ b/spring-resttemplate/README.md
@@ -10,3 +10,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Configure a RestTemplate with RestTemplateBuilder](http://www.baeldung.com/spring-rest-template-builder)
- [Mocking a RestTemplate in Spring](https://www.baeldung.com/spring-mock-rest-template)
- [RestTemplate Post Request with JSON](https://www.baeldung.com/spring-resttemplate-post-json)
+- [Download a Large File Through a Spring RestTemplate](https://www.baeldung.com/spring-resttemplate-download-large-file)
diff --git a/spring-security-mvc-session/pom.xml b/spring-security-mvc-session/pom.xml
index c0e1527a24..276f651436 100644
--- a/spring-security-mvc-session/pom.xml
+++ b/spring-security-mvc-session/pom.xml
@@ -8,10 +8,10 @@
war
- com.baeldung
- parent-spring-4
- 0.0.1-SNAPSHOT
- ../parent-spring-4
+ parent-boot-2
+ com.baeldung
+ 0.0.1-SNAPSHOT
+ ../parent-boot-2
@@ -19,74 +19,26 @@
- org.springframework.security
- spring-security-web
- ${org.springframework.security.version}
-
-
- org.springframework.security
- spring-security-config
- ${org.springframework.security.version}
+ org.springframework.boot
+ spring-boot-starter-securityorg.springframework.securityspring-security-taglibs
- ${org.springframework.security.version}
-
- org.springframework
- spring-core
- ${spring.version}
-
-
- commons-logging
- commons-logging
-
-
+ org.springframework.boot
+ spring-boot-starter-web
- org.springframework
- spring-context
- ${spring.version}
+ org.apache.tomcat.embed
+ tomcat-embed-jasper
- org.springframework
- spring-jdbc
- ${spring.version}
-
-
- org.springframework
- spring-beans
- ${spring.version}
-
-
- org.springframework
- spring-aop
- ${spring.version}
-
-
- org.springframework
- spring-tx
- ${spring.version}
-
-
- org.springframework
- spring-expression
- ${spring.version}
-
-
-
- org.springframework
- spring-web
- ${spring.version}
-
-
- org.springframework
- spring-webmvc
- ${spring.version}
+ org.springframework.boot
+ spring-boot-starter-tomcat
@@ -94,14 +46,12 @@
javax.servletjavax.servlet-api
- ${javax.servlet-api.version}providedjavax.servletjstl
- ${jstl.version}runtime
@@ -117,7 +67,6 @@
org.springframework.bootspring-boot-starter-test
- 1.5.10.RELEASEtest
@@ -166,9 +115,6 @@
-
- 4.2.6.RELEASE
-
3.0.2
diff --git a/spring-security-mvc-session/src/main/java/org/baeldung/SpringSessionApplication.java b/spring-security-mvc-session/src/main/java/org/baeldung/SpringSessionApplication.java
new file mode 100644
index 0000000000..9e52f0430a
--- /dev/null
+++ b/spring-security-mvc-session/src/main/java/org/baeldung/SpringSessionApplication.java
@@ -0,0 +1,12 @@
+package org.baeldung;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SpringSessionApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(SpringSessionApplication.class, args);
+ }
+}
diff --git a/spring-security-mvc-session/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-mvc-session/src/main/java/org/baeldung/spring/MvcConfig.java
index 9e9c240181..b9f50ded73 100644
--- a/spring-security-mvc-session/src/main/java/org/baeldung/spring/MvcConfig.java
+++ b/spring-security-mvc-session/src/main/java/org/baeldung/spring/MvcConfig.java
@@ -5,13 +5,13 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
@EnableWebMvc
@Configuration
-public class MvcConfig extends WebMvcConfigurerAdapter {
+public class MvcConfig implements WebMvcConfigurer {
public MvcConfig() {
super();
@@ -21,7 +21,6 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
- super.addViewControllers(registry);
registry.addViewController("/anonymous.html");
diff --git a/spring-security-mvc-session/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-mvc-session/src/main/java/org/baeldung/spring/SecSecurityConfig.java
index deeea78e4e..b7996ebf18 100644
--- a/spring-security-mvc-session/src/main/java/org/baeldung/spring/SecSecurityConfig.java
+++ b/spring-security-mvc-session/src/main/java/org/baeldung/spring/SecSecurityConfig.java
@@ -8,6 +8,8 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.security.web.session.HttpSessionEventPublisher;
@@ -24,9 +26,9 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
// @formatter:off
auth.inMemoryAuthentication()
- .withUser("user1").password("user1Pass").roles("USER")
+ .withUser("user1").password(passwordEncoder().encode("user1Pass")).roles("USER")
.and()
- .withUser("admin1").password("admin1Pass").roles("ADMIN");
+ .withUser("admin1").password(passwordEncoder().encode("admin1Pass")).roles("ADMIN");
// @formatter:on
}
@@ -68,5 +70,10 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
public HttpSessionEventPublisher httpSessionEventPublisher() {
return new HttpSessionEventPublisher();
}
+
+ @Bean
+ public PasswordEncoder passwordEncoder() {
+ return new BCryptPasswordEncoder();
+ }
}
diff --git a/spring-security-mvc-session/src/main/resources/webSecurityConfig.xml b/spring-security-mvc-session/src/main/resources/webSecurityConfig.xml
index e8aa2f76bc..42ff4c2186 100644
--- a/spring-security-mvc-session/src/main/resources/webSecurityConfig.xml
+++ b/spring-security-mvc-session/src/main/resources/webSecurityConfig.xml
@@ -2,9 +2,9 @@
diff --git a/spring-session/README.md b/spring-session/README.md
index 505d043e75..c9875beadf 100644
--- a/spring-session/README.md
+++ b/spring-session/README.md
@@ -5,3 +5,4 @@
### Relevant Articles:
- [Guide to Spring Session](https://www.baeldung.com/spring-session)
- [Spring Session with JDBC](https://www.baeldung.com/spring-session-jdbc)
+- [Spring Session with MongoDB](https://www.baeldung.com/spring-session-mongodb)
diff --git a/spring-static-resources/README.md b/spring-static-resources/README.md
index c12e0272d4..64f017b5dd 100644
--- a/spring-static-resources/README.md
+++ b/spring-static-resources/README.md
@@ -2,3 +2,4 @@
- [Cachable Static Assets with Spring MVC](http://www.baeldung.com/cachable-static-assets-with-spring-mvc)
- [Minification of JS and CSS Assets with Maven](http://www.baeldung.com/maven-minification-of-js-and-css-assets)
- [Serve Static Resources with Spring](http://www.baeldung.com/spring-mvc-static-resources)
+- [Load a Resource as a String in Spring](https://www.baeldung.com/spring-load-resource-as-string)
diff --git a/testing-modules/junit-5-basics/README.md b/testing-modules/junit-5-basics/README.md
index 6e44a9c071..c09c030780 100644
--- a/testing-modules/junit-5-basics/README.md
+++ b/testing-modules/junit-5-basics/README.md
@@ -2,3 +2,4 @@
- [Get the Path of the /src/test/resources Directory in JUnit](https://www.baeldung.com/junit-src-test-resources-directory-path)
- [Tagging and Filtering JUnit Tests](https://www.baeldung.com/junit-filtering-tests)
+- [JUnit 5 Temporary Directory Support](https://www.baeldung.com/junit-5-temporary-directory)
diff --git a/testing-modules/mockito/pom.xml b/testing-modules/mockito/pom.xml
index acdd7eb2ac..19dbaa0dc1 100644
--- a/testing-modules/mockito/pom.xml
+++ b/testing-modules/mockito/pom.xml
@@ -33,7 +33,7 @@
org.eclipse.persistencejavax.persistence
- 2.1.1
+ ${javax.persistence.version}
@@ -99,6 +99,7 @@
1.7.02.0.0.0
+ 2.1.1
\ No newline at end of file
diff --git a/testing-modules/spring-testing/README.md b/testing-modules/spring-testing/README.md
index 07888d7cdf..0970eabeff 100644
--- a/testing-modules/spring-testing/README.md
+++ b/testing-modules/spring-testing/README.md
@@ -4,4 +4,5 @@
- [A Quick Guide to @TestPropertySource](https://www.baeldung.com/spring-test-property-source)
- [Guide to ReflectionTestUtils for Unit Testing](https://www.baeldung.com/spring-reflection-test-utils)
- [How to Test the @Scheduled Annotation](https://www.baeldung.com/spring-testing-scheduled-annotation)
-- [Override properties in Spring]()
\ No newline at end of file
+- [Using SpringJUnit4ClassRunner with Parameterized](https://www.baeldung.com/springjunit4classrunner-parameterized)
+- [Override properties in Spring]()
diff --git a/testing-modules/spring-testing/pom.xml b/testing-modules/spring-testing/pom.xml
index 0eca9b6a7e..f4d7b5dc66 100644
--- a/testing-modules/spring-testing/pom.xml
+++ b/testing-modules/spring-testing/pom.xml
@@ -51,7 +51,7 @@
org.eclipse.persistencejavax.persistence
- 2.1.1
+ ${javax.persistence.version}org.springframework.data
@@ -95,6 +95,7 @@
5.4.05.1.4.RELEASE4.0.1
+ 2.1.1
\ No newline at end of file
diff --git a/vaadin/pom.xml b/vaadin/pom.xml
index 648343fcd8..089ebe67c1 100644
--- a/vaadin/pom.xml
+++ b/vaadin/pom.xml
@@ -33,7 +33,26 @@
javax.servlet-apiprovided
-
+
+ com.vaadin
+ vaadin-server
+ ${vaadin-server.version}
+
+
+ com.vaadin
+ vaadin-push
+ ${vaadin-push.version}
+
+
+ com.vaadin
+ vaadin-client-compiled
+ ${vaadin-client-compiled.version}
+
+
+ com.vaadin
+ vaadin-themes
+ ${vaadin-themes.version}
+ org.springframework.bootspring-boot-starter-data-jpa
@@ -155,9 +174,13 @@
- 10.0.11
- 10.0.11
- 10.0.11
+ 13.0.9
+ 13.0.9
+ 13.0.9
+ 8.8.5
+ 8.8.5
+ 8.8.5
+ 8.8.59.3.9.v20160517UTF-81.8
diff --git a/vaadin/src/main/java/com/baeldung/introduction/VaadinUI.java b/vaadin/src/main/java/com/baeldung/introduction/VaadinUI.java
new file mode 100644
index 0000000000..68be53b1b3
--- /dev/null
+++ b/vaadin/src/main/java/com/baeldung/introduction/VaadinUI.java
@@ -0,0 +1,278 @@
+package com.baeldung.introduction;
+
+import java.time.Instant;
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import javax.servlet.annotation.WebServlet;
+
+import com.vaadin.annotations.Push;
+import com.vaadin.annotations.Theme;
+import com.vaadin.annotations.VaadinServletConfiguration;
+import com.vaadin.data.Binder;
+import com.vaadin.data.validator.StringLengthValidator;
+import com.vaadin.icons.VaadinIcons;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.server.VaadinServlet;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.DateField;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.InlineDateField;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.ListSelect;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.PasswordField;
+import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.TwinColSelect;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+@SuppressWarnings("serial")
+@Push
+@Theme("mytheme")
+public class VaadinUI extends UI {
+
+ private Label currentTime;
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ protected void init(VaadinRequest vaadinRequest) {
+ final VerticalLayout verticalLayout = new VerticalLayout();
+ verticalLayout.setSpacing(true);
+ verticalLayout.setMargin(true);
+ final GridLayout gridLayout = new GridLayout(3, 2);
+ gridLayout.setSpacing(true);
+ gridLayout.setMargin(true);
+ final HorizontalLayout horizontalLayout = new HorizontalLayout();
+ horizontalLayout.setSpacing(true);
+ horizontalLayout.setMargin(true);
+ final FormLayout formLayout = new FormLayout();
+ formLayout.setSpacing(true);
+ formLayout.setMargin(true);
+ final GridLayout buttonLayout = new GridLayout(3, 5);
+ buttonLayout.setMargin(true);
+ buttonLayout.setSpacing(true);
+
+ final Label label = new Label();
+ label.setId("Label");
+ label.setValue("Label Value");
+ label.setCaption("Label");
+ gridLayout.addComponent(label);
+
+ final Link link = new Link("Baeldung", new ExternalResource("http://www.baeldung.com/"));
+ link.setId("Link");
+ link.setTargetName("_blank");
+ gridLayout.addComponent(link);
+
+ final TextField textField = new TextField();
+ textField.setId("TextField");
+ textField.setCaption("TextField:");
+ textField.setValue("TextField Value");
+ textField.setIcon(VaadinIcons.USER);
+ gridLayout.addComponent(textField);
+
+ final TextArea textArea = new TextArea();
+ textArea.setCaption("TextArea");
+ textArea.setId("TextArea");
+ textArea.setValue("TextArea Value");
+ gridLayout.addComponent(textArea);
+
+ final DateField dateField = new DateField("DateField", LocalDate.ofEpochDay(0));
+ dateField.setId("DateField");
+ gridLayout.addComponent(dateField);
+
+ final PasswordField passwordField = new PasswordField();
+ passwordField.setId("PasswordField");
+ passwordField.setCaption("PasswordField:");
+ passwordField.setValue("password");
+ gridLayout.addComponent(passwordField);
+
+ final RichTextArea richTextArea = new RichTextArea();
+ richTextArea.setCaption("Rich Text Area");
+ richTextArea.setValue("