情景:通过点击一个按钮,获得留言(Message)数据并且显示在表格中
思路:服务器端传送数据的方式是JSON,然后怎样将JSON显示到表格中呢,需要通过拼接字符串对JSON进行改造
1 建立 MessageBean
package com.feidaochuanqing.actions;
public class MessageBean { private int id; private String title; private String content;
public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; }
}
|