Spring documentation says:
Use the @RequestParam annotation to bind request parameters to a method parameter in your controller.
AFA
Yes it works perfectly with post method too. you can mention the method attribute of @RequestParam
as RequestMethod=POST
. Here is the code snippet
@RequestMapping(value="/register",method = RequestMethod.POST)
public void doRegister
(
@RequestParam("fname") String firstName,
@RequestParam("lname")String lastName,
@RequestParam("email")String email,
@RequestParam("password")String password
)