I got this message "The page that you're looking for used information that you entered. Returning to that page might cause any action you took to be repeated. Do you want to continue?" when i try to refresh the page.
This is my controller method
@PostMapping("/savePost")
public String savePost(@RequestParam("content") String content,
@RequestParam(value = "publicPost", required = false) String[] publicPost, ModelMap model) {
boolean isPrivate = publicPost == null ? true : false;
postService.savePost(userService.getLoggedUsername(), content, isPrivate);
// Get user posts
String username = userService.getLoggedUsername();
if (username != null) {
model.addAttribute("posts", postService.findUserPosts(username));
return "createPost";
} else {
return "login";
}
}
and This is my HTML form
<form action="/savePost" method="POST">
.....
</form>
any method how to solve it ?