0

I want to redirect to /post/user's id when user update data. but following code is not working.

@PutMapping("/post/edit/{id}")
    public String update(@PathVariable("id") Long id , @RequestBody BoardDto boardDto) {
        boardService.savePost(boardDto);
        return "redirect:/post/" + id;
   }


@PathVariable("id") Long id
@PathVariable Long id
@PathVariable String id

Whiteable page error pops up too

WARN 12524 --- [nio-8080-exec-4] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported]
Sreyas
  • 744
  • 1
  • 7
  • 25
김진욱
  • 11
  • 1
  • Does this answer your question? [Http Post request with content type application/x-www-form-urlencoded not working in Spring](https://stackoverflow.com/questions/34782025/http-post-request-with-content-type-application-x-www-form-urlencoded-not-workin) – tgdavies Sep 06 '21 at 06:16
  • 1
    Does this answer your question? [Redirect to an external URL from controller action in Spring MVC](https://stackoverflow.com/questions/17955777/redirect-to-an-external-url-from-controller-action-in-spring-mvc) – Sreyas Sep 06 '21 at 07:53
  • that's it! Thank you – 김진욱 Sep 06 '21 at 12:09

0 Answers0