@RequestMapping(value="edit/{postId}", method = RequestMethod.GET) public String displayEditForm(Model model, @PathVariable int postId, Error error){ Artifact thePost = artifactRepository.findById(postId).get(); artifactRepository.save(thePost); model.addAttribute("thePost", thePost); return "edit"; }
@RequestMapping(value="edit/{post_id}", method=RequestMethod.POST) public String processEditForm(@RequestParam(value="edit/{post_id}") @PathVariable int post_id, @RequestParam(value="name") String name, @RequestParam(value="location") String location, @RequestParam(value="description") String description, Model model) { Artifact thePost = artifactRepository.findById(post_id).get(); thePost.setName(name); thePost.setLocation(location); thePost.setDescription(description); artifactRepository.save(thePost); return "index"; }
This is the problem area. I need exact words and descriptions on what it's supposed to look like.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
@RequestMapping(value="edit/{postId}", method = RequestMethod.GET)
public String displayEditForm(Model model, @PathVariable int postId, Error error){
Artifact thePost = artifactRepository.findById(postId).get();
artifactRepository.save(thePost);
model.addAttribute("thePost", thePost);
return "edit";
}
This is the problem area. I need exact words and descriptions on what it's supposed to look like.