validate的用法

引入


		

使用方法


username:
password:
repeatpassword:
age:

若用validate调用后台方法,返回值只能为boolean


      

后台接收数据

   //验证密码
    @RequestMapping("/user/checkpass")
    public void  checkpass(String yuanpass,ModelMap map,HttpServletResponse response){
         UserTb userTb=(UserTb) map.get("u1");
        response.setContentType("text/html;charset=utf-8");
        try {
            PrintWriter out=response.getWriter();
            if(userTb.getUserPs().equals(yuanpass)){
                out.print(true);
            }else{
                out.print(false);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

你可能感兴趣的:(validate的用法)