赞
踩
action建立相应的方法:
/**列表接口*/
public void helpJson() {
ShfwHelpQuery query = newQuery(ShfwHelpQuery.class,DEFAULT_SORT_COLUMNS);
//将query传入到page对象里面
Page page = shfwHelpManager.findPage(query);
JsonConfig jsonConfig = new JsonConfig();
//将后面的参数传入不能解析的参数
jsonConfig.setExcludes(new String[] {"xxnr" });
//再将page和jsonconfig作为变量传入到json对象中
JSON json = JSONSerializer.toJSON(page.getResult(), jsonConfig);
if(query.getPageNumber() <= page.getLastPageNumber() ){
//将json进行字符串类型输出
outJsonString(json.toString());
}else{
outJsonString("[]");
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。