java新手,但很想实现我的工作jsp,它生成一个可爱的jquery flexigrid使用的xml,以使用json版本(由gson生成)。我基本上刚开始使用java,但想学习最好的方法来做到这一点。我一直在研究内部课程,但想看看什么是最佳实践。
json 预期格式(我从这里的另一篇文章中得到)是:
total: (no of rec)
page : (page no)
rows : {id: 1, cell: [ (col1 value) , (col2 value) ,.. ] },
{id: 2, cell: [ (col1 value) , (col2 value) ,.. ] }
而且,到目前为止,我的不可编译的 java 是:
private class _JsonReturn {
int page ;
int total ;
class Rows {
String id = new String();
MultiMap cell = new MultiValueMap() ;
private Rows( String newCell ) {
this.id = newCell ;
}
private void _addRowValue( String cellValue ){
this.cell.put( this.id, cellValue );
}
private Object _getRows() {
return this ;
}
}
}
帮助 - 我想我在这里把事情复杂化了!提前致谢!