@Override protected void validate(Controller controller) { validateRequiredString("users.username", "usernameMsg", "登录名不允许为空!"); validateRequiredString("users.password", "pwMsg", "密码不允许为空!"); validateRequiredString("users.name", "nameMsg", "姓名不允许为空!"); } <li><a href="<%=request.getContextPath()%>/index/login">首页</a></li> <li><a href="#">员工添加/修改</a></li> </ul> </div> <form action="<%=request.getContextPath()%>/user/add" method="post" enctype="multipart/form-data"> <input type="hidden" name="users.id" value="${users.id}"/> <input type="hidden" name="users.createtime" value="${users.createtime}"/> <div class="formbody"> <div class="formtitle"><span>基本信息</span></div> <ul class="forminfo"> <li><label>头像</label><input type="file" name="img"/></li> <li><label>登录名</label><input name="users.username" type="text" class="dfinput" maxlength="10" /><i><font color="red">${usernameMsg}</font>登录名长度不的超过100个字符!注册成功后不可修改!</i></li> <li><label>密码</label><input name="users.password" type="password" class="dfinput" maxlength="8"/><i><font color="red">${pwMsg}</font></i></li> <li><label>确认密码</label><input name="password2" type="password" class="dfinput" maxlength="8" /></li> <li><label>名字</label><input name="users.name" type="text" class="dfinput" maxlength="15"/><i><font color="red">${nameMsg}</font></i></li> <li><label>说明</label><textarea name="users.memo" cols="1" rows="1" class="textinput" maxlength="2"></textarea></li> <li><label> </label><input name="" type="submit" class="btn" value="确认保存"/></li> </ul> </div> </form> </body>
if (StrKit.isBlank(controller.getPara(field))) {
addError(errorKey, errorMessage);
}
这里的 controller.getPara(field) 得到的是null ,我不知道哪里出问题了
项目:JFinal