Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some bugs and edited Readme #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions spring-boot/parse-data-csv/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 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).

<<<<<<< HEAD
If there is a postman error: upload file springboot - `Required request part 'file' is not present`, follow blew link to resolve it.

=======
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:
>>>>>>> 4472729911be7a37bcb038a3becfdcd9b87f9677
https://stackoverflow.com/questions/43936372/upload-file-springboot-required-request-part-file-is-not-present
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
server.port = 8090

spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Upload CSV File Example</title>

<!--Bootstrap 4-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
</head>
<body>
<div class="container py-5">
<div class="row">
<div class="col-10 mx-auto">
<h1>File Upload Status</h1>
<!--display error if any-->
<div class="alert alert-danger" role="alert" th:if="${!status}">
<strong>Error:</strong>
<span th:text="${message}"></span>
</div>

<!--display users list-->
<table class="table table-striped" th:if="${status}">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Country</th>
<th scope="col">Age</th>
</tr>
</thead>
<tbody>
<tr th:each="user, i : ${users}">
<th scope="row" th:text="${i.index + 1}"></th>
<td th:text="${user.id}"></td>
<td th:text="${user.name}"></td>
<td th:text="${user.email}"></td>
<td th:text="${user.countryCode}"></td>
<td th:text="${user.age}"></td>
</tr>
</tbody>
</table>
</div>
</div>

</div>

</body>
</html>