@XStreamAlias注解的用法。

部分1:

js如下(extjs):

// Store 数据源
correctionEndStore = new Ext.data.Store({
storeId : 'correctionEndStore',
url : "correctArchiveEndServlet?action=query&"+ Math.random(),
reader : new Ext.data.XmlReader({
totalRecords : 'countRow',
record : "QueryResult",                                   //注释一
id : 'pk_id'
}, correctionEndRecord),
beforeSend :function(xmlHttp){
            xmlHttp.setRequestHeader("If-Modified-Since","0");
            xmlHttp.setRequestHeader("Cache-Control","no-cache");
        },
baseParams : {
DEPT_PK :     _dept_pk,
SQJZRYBH:        _acode,


java如下(controller):

@RequestMapping(params = "action=query")
public void query(HttpServletRequest request,HttpServletResponse response,CorrectArchiveEndSFVO vo) throws NumberFormatException, Exception{
RequestResult rs = new RequestResult();
//获取请求的分页信息
String pagesize = request.getParameter("limit");

实体类如下:

@Entity
@Table(name="T_CORRECT_END")
@XStreamAlias("QueryResult")                                   //注释二
@Note("矫正解除")
public class CorrectArchiveEndSFVO implements Serializable{

/**

*/
private static final long serialVersionUID = -1914203561625844790L;
@Note("单位")
private Integer ORG_PK=0;


说明:

注释一中的QueryResult和 注释二QueryResult必须对应,否则无法接收到返回的数据。



你可能感兴趣的:(js,hibernate,ExtJS)