public class MyForm {
private String username;
//getter...setter
}
@Controller
public class MyController {
@RequestMapping("/handleForm")
public String handleForm( MyForm form, Model model ){
//do something
}
}
If I submit a form to the above controller with a parameter 'username' all works great. I am currious though, just for user convenience I'd like to shorten the 'username' parameter to 'u' as in: http://mydomain.com?u=rocky (rather than http://mydomain.com?username=rocky).
But I'd rather not have MyForm.u, it's a little hard to read for future maintainability.
Can I map MyForm.username to the form parameter 'u'? Easily?