From 1734250d97b95af9f44e02cf6933bc22ed1a9355 Mon Sep 17 00:00:00 2001 From: Mona Mohamadinia Date: Mon, 30 Mar 2020 21:44:37 +0430 Subject: [PATCH] Added the Static Resource Examples (#8786) --- .../src/main/resources/application.properties | 5 ++++- .../src/main/resources/files/about.html | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 spring-boot-modules/spring-boot-mvc-2/src/main/resources/files/about.html diff --git a/spring-boot-modules/spring-boot-mvc-2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-mvc-2/src/main/resources/application.properties index 709574239b..7070d4c2f0 100644 --- a/spring-boot-modules/spring-boot-mvc-2/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-mvc-2/src/main/resources/application.properties @@ -1 +1,4 @@ -spring.main.allow-bean-definition-overriding=true \ No newline at end of file +spring.main.allow-bean-definition-overriding=true +spring.mvc.static-path-pattern=/content/** +spring.webflux.static-path-pattern=/content/** +spring.resources.static-locations=classpath:/files/,classpath:/static-files \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc-2/src/main/resources/files/about.html b/spring-boot-modules/spring-boot-mvc-2/src/main/resources/files/about.html new file mode 100644 index 0000000000..15df316612 --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-2/src/main/resources/files/about.html @@ -0,0 +1,10 @@ + + + + + Hello World! + + +Hello World! + + \ No newline at end of file