@PostMapping("/save")
public String handleNoteSave(@RequestParam(value = "noteId", required = false) Integer noteId,
@RequestParam("notetitle") String notetitle,
@RequestParam("notedescription")String notedescription,
RedirectAttributes redirectAttributes,
Authentication authentication) {
User currentUser = userService.getUser(authentication.getName());
noteService.saveNote(noteId, notetitle, notedescription, currentUser.getUserid());
redirectAttributes.addFlashAttribute("activeTab", "notes");
redirectAttributes.addFlashAttribute("changeSuccess", true);
return "redirect:/home";
In console, I got this error :
Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required request parameter 'notetitle' for method parameter type String is not present]
In Url, http://localhost:8080/note/save
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Feb 18 19:20:57 KST 2022
There was an unexpected error (type=Bad Request, status=400).
Required request parameter 'notetitle' for method parameter type String is not present
org.springframework.web.bind.MissingServletRequestParameterException: Required request parameter 'notetitle' for method parameter type String is not present
at
I am trying to create an instance of an Object and want ti store I into database, but I have got this error, how can I fix it?