1

i have been strugling since 4 days but did not found the solution for how to bind the url in Spring Boot with gradle.

I have a url as, http://loalhost:8080/blog/post.html?pid=2&ptitle=abc

I want this url to be shown as below with html and (?), http://localhost:8080/blog/post/2/abc

Is there any way to do that. I don't want to use tucky urlrewriter. All my html files are placed in webapp folder.

Thanks in Advance.

Mandeep Singh
  • 857
  • 8
  • 13

1 Answers1

0

if your have a POST method in your @RestController to create a post blog:

@PostMapping("/blog/post/{pid}/{ptitle}")
public void create(@PathVariable("pid") String pid, @PathVariable("ptitle") String ptitle) {
// a repo save call
}

(I supposed that you use last spring boot version)