diff --git a/src/main/java/com/example/demo/controller/UserProfileController.java b/src/main/java/com/example/demo/controller/UserProfileController.java index 2a43314..3497a02 100644 --- a/src/main/java/com/example/demo/controller/UserProfileController.java +++ b/src/main/java/com/example/demo/controller/UserProfileController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @@ -48,9 +49,9 @@ public class UserProfileController { @PostMapping("/user/{id}") // public HashMap putUserProfile(@PathVariable String id, @RequestParam String name, // public void putUserProfile(@PathVariable String id, @RequestParam String name, - public List postUserProfile(@PathVariable String id, @RequestParam String name, - @RequestParam String phone, @RequestParam String address, - @RequestParam MultipartFile upfile) { + public List postUserProfile(@PathVariable("id") String id, @RequestParam("name") String name, + @RequestParam("phone") String phone, @RequestParam("address") String address, + @RequestPart MultipartFile upfile) { String uuid = UUID.randomUUID().toString(); String fileName = upfile.getOriginalFilename(); diff --git a/src/main/webapp/WEB-INF/views/add.jsp b/src/main/webapp/WEB-INF/views/add.jsp index 5f0c43b..d5ce8be 100644 --- a/src/main/webapp/WEB-INF/views/add.jsp +++ b/src/main/webapp/WEB-INF/views/add.jsp @@ -10,21 +10,37 @@