Bonjour,
je me tourne vers vous, car j'essaie désespérément de passer un ModelMap lors d'une redirection. En effet je souhaite, une fois que l'inscription c'est bien passée, redirigé l'utilisateur vers la page d'accueil et lui afficher un message.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
@RequestMapping(value = "subscribe", method = RequestMethod.POST)
	public ModelAndView subscribeAction(@ModelAttribute("customer") Customer customer, BindingResult result){
		ModelMap model = new ModelMap();
 
		accountServices.validate(customer, result);
		if (result.hasErrors()) {
			return  new ModelAndView("Account/public/loginAndSubscribe");
		}
 
		model.addAttribute("flashMessage", AppUtils.flashMessage("success", messages.getString("acc.new.success")));
 
		return new ModelAndView("redirect:/", model);
	}
Et voici la méthode qui intercepte la redirection.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
@RequestMapping("/")
	public ModelAndView IndexHandler(ModelMap model) {
		List<Auction> currentAuctions = auctionServices.getAllCurrentAuctions();
		List<Auction> pendingAuctions = auctionServices.getAllPendingAuctions();
 
		model.addAttribute("currentAuctions", currentAuctions);
		model.addAttribute("pendingAuctions", pendingAuctions);
		return new ModelAndView("Application/index", "data", model);
	}
Auriez-vous une idée de comment je dois procéder ?
Merci d'avance

Alexandre