hoyi新旧写法对比

1.新旧写法都需要继承Hoyipage

2. hoyi 的api访问方式

2.1 新写法 http://localhost:8080/BBCPush/Demo/test.html?username=张三

 
 

@RequestMode (MODE = {RequestType.GET, RequestType.POST})

public void test(String username) { JSONObject jsonObject = new JSONObject(); jsonObject.put("username",username); this.WriteUTF8JSONDATAMSG(1, "成功", jsonObject);

}

2.1.1 需要设置在Eclipse编译时保留方法的形参,如图所示:

2.2 旧写法 http://localhost:8080/BBCPush/Demo.html?behavior=test&username=张三

 
 

@RequestMode (MODE = {RequestType.GET, RequestType.POST}) public void test() { JSONObject jsonObject = new JSONObject(); jsonObject.put("username",this.getParams("username")); this.WriteUTF8JSONDATAMSG(1, "成功", jsonObject);

}


2.3 返回值都是一样的 

{"data":{"username":"张三"},"msg":"成功","status":1}

3. 

4.


2.hoyi 的方法访问新写法  2.

猜你喜欢

转载自blog.csdn.net/dreamJuvenile/article/details/79658174