From 4472729911be7a37bcb038a3becfdcd9b87f9677 Mon Sep 17 00:00:00 2001 From: Shi Date: Fri, 27 Aug 2021 17:25:05 -0400 Subject: [PATCH 1/3] add template html and it runs fine now. add comments in readme on Postman --- spring-boot/parse-data-csv/README.md | 5 +++ .../templates/file-upload-status.html | 36 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html diff --git a/spring-boot/parse-data-csv/README.md b/spring-boot/parse-data-csv/README.md index b308cef..61545c7 100644 --- a/spring-boot/parse-data-csv/README.md +++ b/spring-boot/parse-data-csv/README.md @@ -1,3 +1,8 @@ # Uploading and Parsing CSV File using Spring Boot For step-by-step instructions, please check out [blog post](https://attacomsian.com/blog/spring-boot-upload-parse-csv-file). + +If there is a `upload file springboot Required request part 'file' is not present` error in Postman, follow below link. + +The Postman should look like this: +https://stackoverflow.com/questions/43936372/upload-file-springboot-required-request-part-file-is-not-present \ No newline at end of file diff --git a/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html b/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html new file mode 100644 index 0000000..5335bd1 --- /dev/null +++ b/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html @@ -0,0 +1,36 @@ +
+
+
+

File Upload Status

+ + + + + + + + + + + + + + + + + + + + + + + + + +
#IDNameEmailCountryAge
+
+
+
\ No newline at end of file From ae13913faabce2bf3741973ed1a289ed17afeec5 Mon Sep 17 00:00:00 2001 From: Shi Date: Mon, 30 Aug 2021 10:52:45 -0400 Subject: [PATCH 2/3] add html boilerplate code to make the css work and warning disappear --- spring-boot/parse-data-csv/README.md | 4 ++ .../src/main/resources/application.properties | 3 ++ .../templates/file-upload-status.html | 54 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html diff --git a/spring-boot/parse-data-csv/README.md b/spring-boot/parse-data-csv/README.md index b308cef..406edc5 100644 --- a/spring-boot/parse-data-csv/README.md +++ b/spring-boot/parse-data-csv/README.md @@ -1,3 +1,7 @@ # Uploading and Parsing CSV File using Spring Boot For step-by-step instructions, please check out [blog post](https://attacomsian.com/blog/spring-boot-upload-parse-csv-file). + +If there is a postman error: upload file springboot - `Required request part 'file' is not present`, follow blew link to resolve it. + +https://stackoverflow.com/questions/43936372/upload-file-springboot-required-request-part-file-is-not-present \ No newline at end of file diff --git a/spring-boot/parse-data-csv/src/main/resources/application.properties b/spring-boot/parse-data-csv/src/main/resources/application.properties index 8b13789..e7a81de 100644 --- a/spring-boot/parse-data-csv/src/main/resources/application.properties +++ b/spring-boot/parse-data-csv/src/main/resources/application.properties @@ -1 +1,4 @@ +server.port = 8090 +spring.thymeleaf.prefix=classpath:/templates/ +spring.thymeleaf.suffix=.html diff --git a/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html b/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html new file mode 100644 index 0000000..404670c --- /dev/null +++ b/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html @@ -0,0 +1,54 @@ + + + + + + Upload CSV File Example + + + + + + +
+
+
+

File Upload Status

+ + + + + + + + + + + + + + + + + + + + + + + + + +
#IDNameEmailCountryAge
+
+
+
+ + + + + + From f8c0896dd59872290e7a68a3f88c59938e3d17bc Mon Sep 17 00:00:00 2001 From: Shi Date: Mon, 30 Aug 2021 11:01:31 -0400 Subject: [PATCH 3/3] edit html --- .../src/main/resources/templates/file-upload-status.html | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html b/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html index 602e07d..d152c99 100644 --- a/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html +++ b/spring-boot/parse-data-csv/src/main/resources/templates/file-upload-status.html @@ -1,4 +1,3 @@ -<<<<<<< HEAD @@ -10,9 +9,6 @@ - -======= ->>>>>>> 4472729911be7a37bcb038a3becfdcd9b87f9677
@@ -48,7 +44,7 @@

File Upload Status

-<<<<<<< HEAD +
@@ -56,6 +52,3 @@

File Upload Status

-======= - ->>>>>>> 4472729911be7a37bcb038a3becfdcd9b87f9677