要是@ok()中写了json,那跳转怎么办?要是写了路径,那怎么转json呀?还是直接用response写出去??
22 回复
@At("/showUserJson")
@Ok("beetl:/test/aaa.html")
public Object showUserJson(){
User user2 = new User();
user2.setUsername("ppp");
user2.setAge(200);
user2.setSex(0);
Json.toJson(user2);
return "?";
}
@At("/showUserJson")
@Ok("beetl:/test/aaa.html")
public Object showUserJson(){
User user2 = new User();
user2.setUsername("ppp");
user2.setAge(200);
user2.setSex(0);
return Json.toJson(user2);
}
页面得到的是字符串
@At("/showUserJson")
@Ok("json")
public Object showUserJson(){
User user2 = new User();
user2.setUsername("ppp");
user2.setAge(200);
user2.setSex(0);
return user2;
}
添加回复
请先登陆