Processor Request parameter springmvc

An automatic matching parameters

<form action="/login">
    <input type="text" name="username">
    <input type="password" name="password">
    <input type="submit" value="提交">
</form>
@RequestMapping("/login")
public Object login(String username,String password){
    return "成功";
}

  Values ​​of controls in the form of name, parameter names and methods consistent with the controller layer, the match;

 

Second, the comment form parameters match

@RequestMapping("/login")
public Object login(@RequestParam("usernmae") String name,String password){
    return "成功";
}

 

  

 

Guess you like

Origin www.cnblogs.com/linding/p/12637574.html