<input id="userName" name="user.username" value="${user.username}" placeholder="用户名" class="col-xs-10 col-sm-5" type="text" data-rule="required;length(~20)">
data-rule="required;length(~20)"
其他的参见 http://www.cnblogs.com/hejunrex/archive/2011/11/17/2252193.html