I am learning spring-mvc
and I am doing a simple crud.
I have a list of items with a big add button on top of it.
When the user clicks add it will redirect to /item/add
where the view is a form.
Now, when the user loads a new item I want to show a msg in the list saying something like:
"Item added successfully"
I noticed that I can do something like:
If ( noErrors ) {
model.addAttribute("Item added successfully");
return new ModelAndView("redirect:/item", model);
}
But I didn't manage to get it working.
Any idea?