Caused by: java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'appController' bean method

前端 未结 7 1218
感情败类
感情败类 2021-02-05 10:04

Good morning all, i\'m dealing with an Ambiguous mapping i cannot decode... I\'m using Spring mvc 4.0.6 and hibernate 4.3.6 I\'m getting this error while launching the war in to

7条回答
  •  抹茶落季
    2021-02-05 10:30

    Add params to the following code and you are good to go.

    @RequestMapping(value = {"/new"}, method = RequestMethod.POST, params = "filter")
    public String saveClient(@PathVariable("filter") final String filter,@Valid Client client, BindingResult result, ModelMap model){
        if(result.hasErrors()){
            return "registration";
        }
    
    
        clientService.saveClient(client);
        model.addAttribute("success", "Client" + client.getNomeClient() + "registrato correttamente");
    
        return "success";
    
    }
    
    • Remember to supply params to your url eg https://localhost/url?filter=filterBy OR http://localhost/url/filter based on your url configuration change the controller method accordingly

提交回复
热议问题