HTTP Status 400 - Bad Request - Spring MVC

0

When trying to call a Controller method it is returning the following error:

  

HTTP Status 400 - Bad Request Type Status Report

     

Description The server can not process the request due   something that is perceived to be a client error (e.g., malformed   request syntax, invalid request message framing, or deceptive request   routing).

     

Apache Tomcat / 8.0.53

Controller:

@Controller
public class ManterFuncionarioController {

@RequestMapping("CriarFuncionario")
    public String criarFuncionario(Model model, Funcionario funcionario, Usuario usuario, BindingResult result){
    ///METODO///
}

}

I'm using JSP

I searched for solutions on other topics, but none resolved.

    
asked by anonymous 30.10.2018 / 20:43

1 answer

1

Try to specify the type of request: Post, Get, etc. In your case I believe it's a Post, so the method would look like this:

    @Controller
    @RequestMapping("/funcionarios")
    public class ManterFuncionarioController {

    @RequestMapping(method = RequestMethod.POST, path = "/criar")
        public String criarFuncionario(Model model, Funcionario funcionario, Usuario usuario, BindingResult result){
        ///METODO///
    }
}

In the above example to save you will have to access link and specify your request as Post.

    
31.10.2018 / 01:04