求助EASYUIGRID访问注解方式的SPRING控制层

a_king 2013-12-30 03:11:06
用到注解方式的SPRING控制层,前台数据显示 用的EASYUIGRID,但是在同过EASYUIGRID的URL访问SPRING的控制层获取JSON格式数据时确不能访问,不知道为什么。我的代码如下
$(function() {
$('#tt').datagrid( {
title : '图书信息',
width : 1300,
height : 400,
nowrap : false,
striped : true,
collapsible : true,
pageSize:5,
url : '../system/json.do',
loadMsg : '数据装载中......',
sortName : 'code',
sortOrder : 'desc',
remoteSort : false,
columns : [ [ {
title : '编号',
field : 'id',
width : '100',
rowspan : 2,
align : 'center',
hidden:true
},{
title : '名称',
field : 'book_name',
width : '150',
rowspan : 2,
align : 'center',
editor:'text'
}, {
title : '出版社',
field : 'publish_name',
width : '150',
rowspan : 2,
align : 'center'
}, {
title : '作者',
field : 'author',
width : '150',
rowspan : 2,
align : 'center'
}, {
title : '出版日期',
field : 'publish_date',
width : '150',
rowspan : 2,
align : 'center'
}, {
title : '单价(元)',
field : 'price',
width : '100',
rowspan : 2,
align : 'center'
}
] ],
onBeforeEdit:function(index,row){
row.editing = true;
updateActions(alert());

},
onAfterEdit:function(index,row){
row.editing = false;
updateActions(alert());
},

pagination : true,
rownumbers : false,
showFooter: true,
toolbar : [ {
text : '新增至购物车',
iconCls : 'icon-add',
handler : function() {
addToCart();
}
}, {
text : '查看购物车',
iconCls : 'icon-goto',
handler : function() {
window.location.href="../system/json.do";
}
} ]

});
$('#tt').datagrid('getPager').pagination({
pageSize: 10,//每页显示的记录条数,默认为10
displayMsg:'当前显示第 {from} 条到第 {to} 条记录,共有 {total} 条记录',
showPageList:false,
beforePageText:'当前第',
afterPageText:'页'
});

});


但是在一个连接window.location.href="../system/json.do";却可以访问到控制层,而URLurl : '../system/json.do'换成其他写法url : '/system/json.do';
url : 'system/json.do';url : '项目名/system/json.do'都不行,请高手指点。
...全文
110 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tony4geek 2013-12-31
  • 打赏
  • 举报
回复
分享下,怎么解决
Go 旅城通票 2013-12-30
  • 打赏
  • 举报
回复
楼主你之前不是发过了。。
a_king 2013-12-30
  • 打赏
  • 举报
回复
问题已解决。

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧