小编Obe*_*uel的帖子

如何在调用函数中设置空上下文?

function test(){         
     if(this === null){
        console.log("This is null");
     }else{
         console.log("This is Object");
     }
 }
test.call(null);
test.call({});
Run Code Online (Sandbox Code Playgroud)

输出:

这是对象.

这是对象.

但我期待输出:

这是空的.

这是对象.

为什么Null没有设置在上下文中?

javascript jquery

46
推荐指数
1
解决办法
1327
查看次数

如何在 Java 中验证 JSON 模式?

我尝试使用 JSON 模式检查用户详细信息对象。但我不知道如何在 Java 中检查 JSON 对象。

我的架构:

{
     "type" : "object",
     "properties" : {
     "first_name" : {
                     "type" : "string" , 
                     "minLength"  : 3 , 
                     "maxLength" : 255 
                  }, 
   "last_name" : {
                     "type" : "string" , 
                     "minLength"  : 3 , 
                     "maxLength" : 255 
                  },
    "age"       : { 
                     "type" : "integer" , 
                     "minimum" : 16 ,
                      "maximum" : 40
                  },
    "phone_number" : {
                        "type" : "integer",
                        "pattern" : "[6-9][0-9]{9}"
                     } ,
     "email"     : { 
                       "type" : "string",
                       "pattern" : "[a-z0-9]+" …
Run Code Online (Sandbox Code Playgroud)

java json jsonschema

12
推荐指数
2
解决办法
4万
查看次数

标签 统计

java ×1

javascript ×1

jquery ×1

json ×1

jsonschema ×1