Questo è il codice che non mi da più problemi, corretto come mi hai detto:
codice:@RequestMapping("/hi/{countryName}/{userName}") public ModelAndView hiWorld(@PathVariable java.util.Map<String, String> pathVars) { String name = pathVars.get("userName"); String country = pathVars.get("countryName"); ModelAndView model = new ModelAndView("HelloPage"); model.addObject("msg", "hello " + name + " You are from " + country); return model; }
Questo è l'errore dopo l'esecuzione nel browser che ho ottento:
codice:HTTP Status 500 - Request processing failed; nested exception is org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method [public org.springframework.web.servlet.ModelAndView com.gontuseries.hellocontroller.HelloController.hiWorld(java.util.Map)]; nested exception is java.lang.IllegalStateException: Could not find @PathVariable [pathVars] in @RequestMapping

Rispondi quotando