小小冬 2016-10-01 11:46 采纳率: 0%
浏览 3756

在线等我后台传输到前台的数据为什么显示不出来(500错误 )

 <table class="easyui-datagrid" id="itemList" title="商品列表" 
       data-options="singleSelect:false,collapsible:true,pagination:true,url:'/rest/item',method:'get',pageSize:30,toolbar:toolbar">
    <thead>
        <tr>
            <th data-options="field:'ck',checkbox:true"></th>
            <th data-options="field:'id',width:60">商品ID</th>
            <th data-options="field:'title',width:200">商品标题</th>
            <th data-options="field:'cid',width:100">叶子类目</th>
            <th data-options="field:'sellPoint',width:100">卖点</th>
            <th data-options="field:'price',width:70,align:'right',formatter:TAOTAO.formatPrice">价格</th>
            <th data-options="field:'num',width:70,align:'right'">库存数量</th>
            <th data-options="field:'barcode',width:100">条形码</th>
            <th data-options="field:'status',width:60,align:'center',formatter:TAOTAO.formatItemStatus">状态</th>
            <th data-options="field:'created',width:130,align:'center',formatter:TAOTAO.formatDateTime">创建日期</th>
            <th data-options="field:'updated',width:130,align:'center',formatter:TAOTAO.formatDateTime">更新日期</th>
        </tr>
    </thead>
</table>

这些是页面的请求;

后台代码:
//查询商品列表;
@RequestMapping(method=RequestMethod.GET)
public ResponseEntity queryItemList(
@RequestParam(value="page",defaultValue="1") Integer pageNum,
@RequestParam(value="rows", defaultValue="30") Integer pageSize){
//因为easyui数据表格需要两个数据去做分页显示
try {
EasyUIResult easy=itemService.queryOrderbyCreated(pageNum,pageSize);

        if(easy == null){
            ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
        }else {
            ResponseEntity.ok(easy);
        }
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);



}

业务层:
public EasyUIResult queryOrderbyCreated(Integer page, Integer rows) {
//将查询出来的数据封装到easyuiresult中去;
PageHelper.startPage(page,rows);
Example example=new Example(Item.class);

    //调用商品的映射去向数据库发送查询
            List<Item> selectByExample = this.itemMapper.selectByExample(example);

    System.out.println(selectByExample.size());
    PageInfo<Item> info = new PageInfo<Item>(selectByExample);

    return new EasyUIResult(info.getTotal(), info.getList());
}

查询结果:
mapper查询的时候是有结果的:
Preparing: SELECT CID,ID,UPDATED,STATUS,PRICE,CREATED,IMAGE,BARCODE,SELL_POINT SELLPOINT,TITLE,NUM FROM tb_item limit ?,?
[DEBUG] ==> Parameters: 0(Integer), 30(Integer)
ItemMapper.selectByExample_PageHelper]-[DEBUG] <== Total: 4
2016-10-01 19:41:56,645 [http-bio-8081-exec-2] [org.mybatis.spring.SqlSessionUtils]-[DEBUG] Transaction synchronization committing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7c4159a6]
2016-10-01 19:41:56,645 [http-bio-8081-exec-2] [org.mybatis.spring.SqlSessionUtils]-[DEBUG] Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7c4159a6]
2016-10-01 19:41:56,645 [http-bio-8081-exec-2] [org.mybatis.spring.SqlSessionUtils]-[DEBUG] Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7c4159a6]
2016-10-01 19:41:56,645 [http-bio-8081-exec-2] [org.springframework.jdbc.datasource.DataSourceTransactionManager]-[DEBUG] Initiating transaction commit
2016-10-01 19:41:56,645 [http-bio-8081-exec-2] [org.springframework.jdbc.datasource.DataSourceTransactionManager]-[DEBUG] Committing JDBC transaction on Connection [ConnectionHandle{url=jdbc:mysql://127.0.0.1:3306/taotao?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true, user=root, debugHandle=null, lastResetAgoInSec=0, lastUsedAgoInSec=0, creationTimeAgoInSec=0}]
2016-10-01 19:41:56,646 [http-bio-8081-exec-2] [org.springframework.jdbc.datasource.DataSourceUtils]-[DEBUG] Resetting read-only flag of JDBC Connection [ConnectionHandle{url=jdbc:mysql://127.0.0.1:3306/taotao?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true, user=root, debugHandle=null, lastResetAgoInSec=0, lastUsedAgoInSec=0, creationTimeAgoInSec=0}]
2016-10-01 19:41:56,646 [http-bio-8081-exec-2] [org.springframework.jdbc.datasource.DataSourceTransactionManager]-[DEBUG] Releasing JDBC Connection [ConnectionHandle{url=jdbc:mysql://127.0.0.1:3306/taotao?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true, user=root, debugHandle=null, lastResetAgoInSec=0, lastUsedAgoInSec=0, creationTimeAgoInSec=0}] after transaction
2016-10-01 19:41:56,646 [http-bio-8081-exec-2] [org.springframework.jdbc.datasource.DataSourceUtils]-[DEBUG] Returning JDBC Connection to DataSource
2016-10-01 19:41:56,693 [http-bio-8081-exec-2] [org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdviceChain]-[DEBUG] Invoking ResponseBodyAdvice chain for body=null
2016-10-01 19:41:56,693 [http-bio-8081-exec-2] [org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdviceChain]-[DEBUG] After ResponseBodyAdvice chain body=null
2016-10-01 19:41:56,693 [http-bio-8081-exec-2] [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] Null ModelAndView returned to DispatcherServlet with name 'taotao-manage': assuming HandlerAdapter completed request handling
2016-10-01 19:41:56,693 [http-bio-8081-exec-2] [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] Successfully completed request

NetworkError: 500 Internal Server Error

  • 写回答

1条回答 默认 最新

  • devmiao 2016-10-01 16:04
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘