@XStreamAlias注解的用法。
2016-10-21 14:49
176 查看
部分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如下(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必须对应,否则无法接收到返回的数据。
相关文章推荐
- xstream中几个注解的含义和用法
- @XStreamAlias注解的使用
- XStream 如何使用注解定义别名
- 用 @Value("${xxxx}")注解从配置文件读取值的用法
- shiro注解@RequiresPermissions多权限任选一参数用法
- @XstreamAlias()
- @RequestMapping注解的用法
- @Param注解的用法解析
- XStream日期转换,注解转换
- Spring MVC 使用@RequestMapping 注解基本用法
- activity-alias的用法
- Redis系列三 - Spring boot如何使用redis做缓存及缓存注解的用法总结
- @Cacheable 缓存注解的用法
- @Query注解的用法(Spring Data JPA)
- Spring @ModelAttribute注解用法
- @Query注解的用法(Spring Data JPA)
- Spring注解 @AliasFor
- spring的@Transactional注解详细用法
- @RequestBody注解的用法
- Nginx的alias的用法及与root的区别