jsonp报错Uncaught SyntaxError: Unexpected token :

问题:由于jsonp返回的是callback(json);但是服务器端的返回数据是json(不能改变),我在客户端属于跨域请求,如何解决报错,同时返回这个json?
我的请求:
图片说明
返回的错误:
图片说明
应该返回的结果:
{"access_token":"z69yi55wi_pQYj4saYPmxHLkoMyTys9MsPPKQhlCasJcHdJ7Ir0AMImT1Pqx6vx9E9jEhH2kkMA8cc_Ss_HoOqjYagU6gmVxjhciAoEVSg1dU4vOwc0Xni0Wq5MpM67LLPXeCGASWE","expires_in":7200}

2个回答

楼主先去了解什么是jsonp,你的这个接口就不支持jsonp好不,返回了json而已,jsonp是一段可以执行的js代码

asi991
骑着丶蜗牛去看海 回复Rattenking: 你是怎么解决的?我也遇到相同的问题,可以告诉下吗?
大约 2 年之前 回复
m0_38082783
Rattenking 谢谢,可以了,终于找到解决办法了。感谢!
2 年多之前 回复
m0_38082783
Rattenking 额,好的,我看看,我做的时候是放在后端做的,我这里主要是想做一个跨域请求json的测试。谢谢!
2 年多之前 回复
showbo
支付宝加好友偷能量挖 回复Rattenking: 你可以试试yql,将json转为jsonp。http://www.w3dev.cn/article/20130228/JSONP-crossdomain-online-httpproxy-api.aspx不过你将appid,secret这种信息放到客户端别人都看到了,都没安全性了。微信的获取授权接口一般都是服务器端处理的
2 年多之前 回复
m0_38082783
Rattenking 就是接口给的json,我希望跨域请求到,大神,前端技术有解决办法么,不通过后端?
2 年多之前 回复
m0_38082783
Rattenking 我知道这个问题,我的意思是能不前端跨域请求json,接口给的就是json。
2 年多之前 回复

能说明一下最后是怎么解决的么

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
jsonp报错Uncaught SyntaxError: Unexpected token :
问题:由于jsonp返回的是callback(json);但是服务器端的返回数据是json(不能改变),我在客户端属于跨域请求,如何解决报错,同时返回这个json?n我的请求:n![图片说明](https://img-ask.csdn.net/upload/201706/16/1497581595_624870.png)n返回的错误:n![图片说明](https://img-ask.csdn.net/upload/201706/16/1497581618_298228.png)n应该返回的结果:n"access_token":"z69yi55wi_pQYj4saYPmxHLkoMyTys9MsPPKQhlCasJcHdJ7Ir0AMImT1Pqx6vx9E9jEhH2kkMA8cc_Ss_HoOqjYagU6gmVxjhciAoEVSg1dU4vOwc0Xni0Wq5MpM67LLPXeCGASWE","expires_in":7200n
js Uncaught SyntaxError: Unexpected token
rnrn```rn rn源代码rn rnrnrnrn rnrn```rnrn
Uncaught SyntaxError: Unexpected token ILLEGAL
function menuClickHandler(id)n n var $this = $('#' + id);n var data = $($this).attr('data');n data = eval('('+data+')');//这句话有问题吗 ?n var src = data['URL'];n var projectName = src.substring(0, src.indexOf('/'));n //var local = resourceLocal[projectName];n var host = window.location.host;n src = "http://" + host+"/"+src;n var currSrc = $('#mainframe').attr('src');
jquery-1.8.3.min.js:2 报错 Uncaught SyntaxError: Unexpected token
框架是shiro+springmvcrn当我清除浏览数据时,点击页面上一个datagrid tree,后台其实已经走了这段代码,但是会反复进来判断rn@RequestMapping(value = "/login", method = RequestMethod.GET)rn public String login(HttpServletResponse response) rn if (SecurityUtils.getSubject().isAuthenticated()) rn return "redirect:/main";rn rn response.setContentType("text/html");rn return "login";rn rn然后F12看报错如下图[img=https://img-bbs.csdn.net/upload/201707/07/1499419211_888959.jpg][/img]rn
Uncaught SyntaxError: Unexpected token问题
[code=csharp] var huifu = '';rn huifu += '';[/code]rn当点击button的时候谷歌浏览器会提示如下错误rnUncaught SyntaxError: Unexpected token
Uncaught SyntaxError: Invalid or unexpected token报错
get1:function()rn this.$http.jsonp("http://api.ly93.cc/kw.php?id=7214800&ext=flac&rate=2000",rn id:7214800rn ,rn jsonp:"callback"rn ).then(function(data) rn var result=JSON.stringify(data);rn console.log(result)rn )rn ,rnrnrn获取数据的时候老是报错rnrnUncaught SyntaxError: Invalid or unexpected tokenrnrnrn我看了错误提示rn "id": 7214800,rn "ext": "flac",rn "rate": 2000,rn "url": "http://nmobi.kuwo.cn/mobi.s?f=kuwo&q=R8ngNi17rInncUbiOVBI8V0BJzJODsANHbUI3IEkHudRwINDBOvYbE0xWa1My+8k+bmceK/YmpW8hPFMptntMl5K9dWge9KEIGyuvwOIsuCRAcRvUqhAdgBiZRX9VKg7DcnMJZid2QYoqjsfi4QwhvAs/8iJgi8mhbGAK9T+ARM0iqIa+py66xHHgRplR5TY1U64Yh2Cg68feyrPSohZILChWaJVrkm17BFiE4FxyvgjhcNVUEP52vLiERMfIGfrJYjGgHUnox6m/aBZMHZLIqWbKthM1NL0"rnrnrn这个是获取的,在id哪里报错了 该怎么解决
chrome报错:Uncaught SyntaxError: Unexpected token )
它报这个错是什么意思啊?rn而且指向的是第一行。。rnrn如图:rn[img=http://outsky.org/chromeBug.png][/img]rnrnrnUncaught SyntaxError: Unexpected token )
Uncaught SyntaxError: Unexpected token else
switch (time)rn case '1': //包月rn console.log(pay_time);rn if ( pay_time<'3' )//无优惠rn total_fee=price*pay_time;rn else if( pay_time<'6' )//减2元rn total_fee=price*pay_time-2;rn else if( pay_time<'12' )//减5元rn total_fee=price*pay_time-5;rn else//减10*x元rn total_fee=price*pay_time-Math.floor(pay_time/12)*10;rn rn break;rn case '2':rn total_fee=price*pay_time-pay_time*10;rn break;rn default :rn break;rnrn这段js代码,一直报错:Uncaught SyntaxError: Unexpected token else ,哪位高人帮忙看下。
Uncaught SyntaxError: Unexpected token do
[img=https://img-bbs.csdn.net/upload/201710/07/1507341876_861357.png][/img]rnrn[code=php]rn rn[/code]rnrn报错(index):115 Uncaught SyntaxError: Unexpected token do
Uncaught SyntaxError: Unexpected token ILLEGAL 求解!!
小菜在将一个HTML页整合到DZ论坛的时候出现了如下错误:rnrnUncaught SyntaxError: Unexpected token ILLEGALrnrn[color=#FF0000]错误行内容为: var html = ' [/color]rnrnrn以下是代码中的部分代码:rnrn[color=#0000FF] //模拟费用rnrn var showPrice = function() rnrn var price = $.trim($('.traffic .t_title input').val());rnrnrnrn //var oo = /(^d+$)|(^d+.d+$)/;rnrn //var oo = /^d+(.d+)?$/;rnrn var oo = /^(d)+$/;rnrn if (!oo.test(price) || price == '') rnrn $('.traffic .t_title input').val('');rnrn price = '';rnrn //alert("请输入正确的价格");rnrn else rnrn var frist = price.substring(0, 1);rnrn if (frist == '0') rnrn alert('基础流量费用不能少于1¥');rnrn return false;rnrn rnrn rnrn if (price.toString().length > 10) rnrn alert("费用不能超过10位数");rnrn return false;rnrn rnrnrnrn if (price == '') rnrn alert('请正确输入整数基础流量费用');rnrn return false;rnrn rnrn var input = $('#formParam input');rnrn var a = input.eq(3).val();rnrn var b = input.eq(4).val();rnrn var trafficBox = $('.traffic .trafficBox');[/color]rnrnrnrnrn [color=#FF0000] var html = ' 《===谷歌浏览器显示此行错误 rn错误信息为:Uncaught SyntaxError: Unexpected token ILLEGALrn[/color]rn [color=#0000FF] 当月流量rnrn ' + a / 1024 + 'G以下流量rnrn ' + a / 1024 + 'G-' + b + 'G流量rnrn ' + b + 'G-' + (b * 2) + 'G流量 rnrn ' + (2 * b) + 'G-' + (4 * b) + 'G流量rnrn ' + (4 * b) + 'G-' + (8 * b) + 'G流量rnrn rnrn rnrn 所需费用rnrn 免费rnrn ¥' + price + 'rnrn ¥' + (2 * price) + 'rnrn ¥' + (3 * price) + 'rnrn ¥' + (4 * price) + 'rnrn rnrn ';rnrn rnrn trafficBox.html(html);rnrn $('.traffic .attd').hide();rnrn trafficBox.show();rnrn rnrn $("#freePrice").val($("#setPrice").val());rnrn return true;rnrn [/color]
Uncaught SyntaxError: Unexpected identifier
作为一个江湖菜鸟,碰到一个非常头疼的问题,网上多说少“,”,但是我实在是水平有限,求大神救我rn[img=https://img-bbs.csdn.net/upload/201602/01/1454324596_476073.jpg][/img]rn附录出相应的运行代码。rn下面是对应的调试模式rn[img=https://img-bbs.csdn.net/upload/201602/01/1454324571_300001.jpg][/img]rn想问各位大神如何解决。
报Uncaught SyntaxError: Unexpected identifier
var a=" 编辑";rn大神,我是引号没加对吗?单引和双引的区别是什么?
jquery parseJson报错SyntaxError: Unexpected token b
$.parseJSON('"content":" \u6b63\u5728\u601d\u8003\uff0c\u8bf7\u7a0d\u540e\u2026\u2026\u6211\u5728\u6d4b\u8bd5<\/p> #include \r\n\r\nint main()\r\n printf("hello world!");\r\n return 0;\r\n<\/pre> <\/p>"'); rn我的代码如上,其中"content":" \u6b63\u5728\u601d\u8003\uff0c\u8bf7\u7a0d\u540e\u2026\u2026\u6211\u5728\u6d4b\u8bd5<\/p> #include \r\n\r\nint main()\r\n printf("hello world!");\r\n return 0;\r\n<\/pre> <\/p>"是通过后台php的json_encode函数进行编码的。但是报错。不知要如何修改。各位看看我错在了哪里?
js 一直报这个错误Uncaught SyntaxError: Unexpected token :
用json返回数据,格式都是正确的但是就是没有结果!一直报这个错误时什么原因?
Uncaught SyntaxError: Unexpected token },但大括号闭合正确的解决办法
在使用ajax技术编写程序,实现在浏览器中点击按钮时,修改按钮上方显示的文字信息,界面如图:鼠标点击“changeContent”按钮,按钮上方显示的文字应该变为“hello world”,但是却提示Uncaught SyntaxError: Unexpected token },但是仔细查看程序,发觉程序中的大括号使用没有错误,感到很奇怪,找了很久才发现是&amp;lt;input type=&quot;butt...
这是什么错误Uncaught SyntaxError: Unexpected token ILLEGAL
什么错误
求帮忙Uncaught SyntaxError: Unexpected token u in JSON at position 0
遇到报错,storageData是string。rnrnUncaught SyntaxError: Unexpected token u in JSON at position 0rn at JSON.parse ()rnrn代码如下rn $(document).ready(function() rnrn $("#siteMapContent").css("background-image", "radial-gradient(at 50% 50%, " + globalColor['canvasBackgroundInColor'] + ", " + globalColor['canvasBackgroundOuterColor'] + ")");rn $("#websiteDiv").find(".info-div").children("a").eq(0).css("background-color", globalColor['atlasTagBgColor']);rn var data;rn var storage = window.sessionStorage;rn var storageData = storage.getItem('canvasAllNodeData'); rn if(storageData) rn data = JSON.parse(storageData);rn else rn data = getSqlData();rn storage.setItem('canvasAllNodeData', JSON.stringify(data));rn rnrn initSqlData(data);rn )rn
JSONP跨域请求数据报错 “Unexpected token :”的解决办法
原文  http://www.cnphp6.com/archives/65409 Jquery使用ajax方法实现jsonp跨域请求数据的时候报错 “Uncaught SyntaxError: Unexpected token :”,主要问题在于返回的数据格式不正确 本地虚拟两个域名,分别为:www.test.com、www.abc.com http://www.test.com/ind
JSONP跨域请求数据报错 Unexpected token 的解决办法
JSONP跨域请求数据报错 Unexpected token 的解决办法
jsonp的问题:请大家帮看看哪里错了“Uncaught SyntaxError: Unexpected token : ”
json真难搞,经常这里错哪里错,还找不到原因。今天调试下面的代码,通过jsonp获取其它服务器中的数据,谷歌总是提示下面的错误:rnResource interpreted as Script but transferred with MIME type text/json: "http://127.0.0.1:81/jsonp.php?callback=jQuery16206906629570294172_1365317138501&_=1365317138505". jquery-1.6.2.js:7752rnUncaught SyntaxError: Unexpected token : jsonp.php:1rnrnIE浏览器提示:rn行:2rnChar:8rn错误:缺少';'rn代码:0rnURL:http://localhost/ajax/jqueryajax.htmlrnrn代码如下:rnhttp://localhost/ajax/jqueryajax.html文件源码:rnrnrn rnrnrn rn rnrnrnrnhttp://127.0.0.1:81/jsonp.php文件源码:rnrnrn我在我电脑里运行了两个php环境,两个程序分别放在不同的环境中,他们的端口号不一样。rn请大家帮看看哪里错了,我就是找不到哪里错了。
ajax跨域调用Webservices报错"Uncaught SyntaxError: Unexpected identifier"
前端代码:rnrnvar userData2 = rn requestUrl: "http://localhost:30213/Service1.asmx/HelloWorld?jsoncallback=?",rn rn requestParams: PageSize: 20,CurrentPage: 10,rn //回调函数rn requestCallBack: function (json) rn if (json.Code == 1) //成功获取数据rn var addRow = function (key, value) rn return "" + key + ":" + value + " ";rn rn userData2.resultData= json.Data;rn var resultHtml = "";rn $(userData2.resultData).each(function () rn resultHtml += addRow("行号", this.RowNo);rn resultHtml += addRow("产品编码", this.cinvcode);rn resultHtml += " ";rn );rn $(".result").html(resultHtml);rn rn elsern $(".result").html(json.Msg); //无数据或者后台处理失败!rn ,rn //查询得到的数据rn resultData: nullrn ;rnrn$(function () rn rn $("#btnSearch").click(function () rn rn $.ajax(rn url: userData2.requestUrl, rn data: userData2.requestParams,rn type: "get", rn dataType: "jsonp",rn jsonp: "jsoncallback",rn success: userData2.requestCallBackrn ) rn rn );rn );rnrn后台代码:rnpublic void HelloWorld(int PageSize, int CurrentPage)rn rn SqlAdapter sqlAdapter = new SqlAdapter();rn sqlAdapter.CreateDB();rnrn string sqlString = "";rn string sqlString1 = "";rn Result result = new Result();rn sqlString1 = @"select cinvcode from inventory";rn sqlString = @" SELECT * FROM rn (SELECT ROW_NUMBER() OVER(ORDER BY cinvcode DESC) RowNo,cinvcode fromrn (select cinvcode from inventory)Krn )tb rn WHERE tb.RowNo BETWEEN str(((cast( '" + CurrentPage + "' as int)-1)*(cast ('" + PageSize + "' as int))+1)) and str((cast( '" + CurrentPage + "' as int))*(cast ('" + PageSize + "' as int)))";rn if (DB.RunProcScalar(sqlString1) == "0")rn rn result.Code =0;rn result.Msg = "不存在";rn rn elsern rn DataTable dtLogin = new DataTable(); rn DB.RunProcDataTable(sqlString, ref dtLogin);rn DataTable dtLogin1 = new DataTable();rn DB.RunProcDataTable(sqlString1, ref dtLogin1);rn int count = dtLogin1.Rows.Count;rn result.Code = 1;rn result.Msg = "共有"+count+"条记录";rn result.Data = Json.DataTableToJson(dtLogin);rn rn rn string jsoncallback = HttpContext.Current.Request["jsoncallback"]; rn string Result = jsoncallback + "(" + new JavaScriptSerializer().Serialize(result).Replace("\\\"", "\"") + ")";rn HttpContext.Current.Response.Write(Result);rn HttpContext.Current.Response.End();rn rnrn[img=https://img-bbs.csdn.net/upload/201705/24/1495594907_916263.png][/img]rnrn[img=https://img-bbs.csdn.net/upload/201705/24/1495594924_322005.png][/img]rnrn如图所示,这个错误提示我百度了多数是由于缺少逗号的,和我这里不太吻合,希望大神指点一下
请求API报SyntaxError: Unexpected token :
rn请求部分代码rn$("#jqrwd").click(function()/*机器人问答*/rn $.ajax(rn url: "http://op.juhe.cn/robot/index?info=" + $('#jqrwdrlnr').val() + "&dtype=&loc=&lon=&lat=&userid=&key=5734f3d9bfc41ccd5ebf96c7829a1fef",rn type: 'GET',rn dataType: 'jsonp',rn success: function (data) rn var json = eval(data);rn alert(json);rn var text = json.result.text;rn var text2 = json.result.code;rn alert(text);rn $("#wllttqtext").html(text+text2) ;rn ,rn error:function()rn alert("请求出错!");rn rn );rn );rn[img=https://img-bbs.csdn.net/upload/201702/04/1486175450_855926.png][/img]
一个switch循环 说是SyntaxError: Unexpected token
var getReview = function (movie) rn rn switch(movie)rn case(Matrix)rn return"good trip out";rn rn case(Princess Bride)rn return"awesome date night movie";rn rn case(Welcome to America)rn return"Amjad's favorite";rn rn case(Remember the Titans)rn return"love the sports";rn rn case(Why do I look like ) rn return"The Ryan and Zach story";rn rn rn case(Fighting Kangaroos in the wild)rn return "Token Australian movie for Leng";rn rn rn faultrn return"I don't know!"; rn rn rn rn ;rnrn[color=#FF0000]getReview(Princess Bride);[/color]rn[color=#FF0000]SyntaxError: Unexpected token [/color]rn不知道哪里错了,各位给看看吧
a.html:1 Unacaught SyntaxError: Unexpected token
求大佬们指点下,为什么会这样了,该怎么解决了n异常情况:n![图片说明](https://img-ask.csdn.net/upload/201804/12/1523525393_333310.png)n页面渲染后:n![图片说明](https://img-ask.csdn.net/upload/201804/12/1523525738_831568.png)n这是代码:n![图片说明](https://img-ask.csdn.net/upload/201804/12/1523525439_941346.png)
新手求指点,js代码报错Uncaught SyntaxError: Unexpected token ,实在不知错在哪里
-
将变量做为一个对象的key,push进一个数组,报错:Uncaught SyntaxError: Unexpected token .
版权声明:本文为博主原创文章,未经博主允许不得转载。 将变量做为一个对象的key,push进一个数组,报错:Uncaught SyntaxError: Unexpected token .,解决方案:在对象的键上加上[]就可以了。 ...
js报错,Uncaught SyntaxError: Unexpected token 不知道哪里错,求解答!
rnrn function processResponse(data)rn rn data=eval("("+data+")");rn $("#result").removeClass("none");rn if(data.status == 1)rn rn $("#result").html('登录成功!正在跳转~');rn window.location = ":U("Index/index")";rn elsernrn[img=https://img-bbs.csdn.net/upload/201311/30/1385801000_262437.jpg][/img]rnrn新手不太懂,登录网站后台,登录之后就没反应,求各位解答,非常感谢
Uncaught SyntaxError: missing ) after argument list 报错?
这个语法没有错怎么会报错?rnUncaught SyntaxError: missing ) after argument listrnrnrnrnrnrnrn```rnfunction drag()//拖拽函数rn         return force.drag()rn             .on("dragstart",function(d)rn                 d3.event.sourceEvent.stopPropagation(); //取消默认事件rn                 d.fixed = true;    //拖拽开始后设定被拖拽对象为固定rn rn ;rn```
使用 jsonp 跨域请求数据报错 “Unexpected token :” 的解决办法
错误的原因是:服务端返回数据的格式有问题。 使用 jQuery的ajax方法($.ajax) 方法中参数的含义: type:请求方式 GET/POST url:请求地址 async:布尔类型,默认为true 表示请求是否为异步,如果为false表示为同步。 dataType:返回的数据类型 jsonp:传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(一般默认...
HQL查询语句报错 unexpected token
hibernate中我查询两张表中的数据,我这样写查询语句,但就是抱错 select t.name,t.type,s.name from Ren t inner join Type s on t.type=s.id 错误如下: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 1, column 64 [select t.name,t.type,s.name from liubi.Ren t inner join Type s on t.type=s.id]
JavaScript控制台报错:unexpected token (
新手,求大神不吝赐教rnrn[code=javascript]rnrnrn 增删节点rn rnrn rnrnrn rn rn 春rn 夏rn 秋rn 冬rn rnrn[/code]
Uncaught SyntaxError: Unexpected identifier 未捕获的语法错误:意外的标志符
原因: (1). ( 这两个符号的字体可能是中文 (2)少逗号,少分号。 比如:字符串类型,但是并没有加双引号。 document.getElementById('s3_selectCustomName').value=customName; 可能会出现上述错误。改正方法: document.getElementById('s3_selectCustomName').value=&quot;custo...
js里方法调用传参长字符串时为对象或者Uncaught SyntaxError: Unexpected token ILLEGAL
这个是因为参数传递时没有被当做字符串传递 可加上引号传递解决 var nr = ''+users[i].fullName+'['+users[i].cellPhone+'];'; 拼接的代码串可用转译符 \'  \"  之类的来解决
1,返回的数据为什么在js的success里面拿不到数据的原因。2,Uncaught SyntaxError: Invalid or unexpected token
【1】j就拿ssm为框架的项目 1,你没有给你的返回值进行json的数据格式的转化 1&amp;gt;.或者你的contorller没有有返回值的注解@ResponseBody 2&amp;gt;.或者你的js里面没有确定返回值的数据格式转换dataType:json 2,就是你在controller和你的js返回值的里面同时会制定两返回数据格式json 【2】Uncau...
微信小程序问题(2)——如何解决错误代码“Uncaught SyntaxError: Invalid or unexpected token”
下午小编在加班写代码的过程中遇到了这样的问题 关于一段错误的代码表示“Uncaught SyntaxError: Invalid or unexpected token” 由于我也是最近才开始学习,至于为什么会出现这样的问题呢,在我们小程序开发的过程中各种view标签由于数量过多,导致无法正确的进行嵌套就会出现这样的问题。 解决方法:只需要从头核对关于&amp;lt;view&amp;gt;&amp;lt;/v...
Uncaught SyntaxError: Unexpected token < in JSON at position 0 这个要怎么解决?
[img=https://img-bbs.csdn.net/upload/201705/31/1496217692_511854.png][/img]
json解析格式问题 Uncaught SyntaxError: Unexpected token < in JSON at position 2
json格式解析配置也配置了 在控制器直接返回一个集合对象 在网页调试显示JSON格式错误,不知道怎么解决rn错误代码信息:rnUncaught SyntaxError: Unexpected token < in JSON at position 2rnrn请大哥们帮帮忙看一下 ,谢谢!以下是代码rnrn一、ajax请求代码rnfunction queryAround(hid) rn var user = sessionStorage.getItem("user");rn if (!user) rn window.location.href = "login.html";rn else rn $.post("/hotel/around/around/getArounds.shtml", rn hid : hidrn ,function(result1) rn var data1 = $.parseJSON(result1);rn var arr = [];rn for (var i = 0; i < data1.length; i++) rn arr.push(" "+123+"");rn arr.push(" " + data1[i].aroundName + "" + data1[i].reson + "");rn $("#arounds").html(arr.join(""));rn rn );rn rn rnrn二、控制器响应代码rn@Controllerrn@RequestMapping(value = "/around")rnpublic class AroundController extends BaseController rnrn @Autowiredrn AroundService aroundService;rnrn /**rn * 获取周边rn * rn * @returnrn */rn @RequestMapping(value = "/around/getArounds", method = RequestMethod.POST)rn @ResponseBodyrn public List getArounds(SearchVO searchVO, HttpServletRequest request, ModelMap modelMap) rn Integer hid = Integer.parseInt(request.getParameter("hid"));rn List li = aroundService.getByHid(hid);rn return li;rn rnrnrn三、spring-mvc json格式自动解析配置rnrnrn rn rn rn text/html;charset=UTF-8rn text/json;charset=UTF-8 rn application/json;charset=UTF-8 rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn
Uncaught SyntaxError: Invalid regular expression
Uncaught SyntaxError: Invalid regular expression:rn一堆特殊字符 乱码rn: Range out of order in character classrn at RegExp ()rn at Object. (babel.min.js:6)rn at t (babel.min.js:1)rn at Object.t.__esModule (babel.min.js:18)rn at t (babel.min.js:1)rn at Object. (babel.min.js:2)rn at t (babel.min.js:1)rn at Object.e.exports (babel.min.js:1)rn at t (babel.min.js:1)rn at Object.e.exports.version (babel.min.js:1)
hibernate报错unexpected token: mo near lin
运行了半天 报这个错误rnException in thread "main" org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: mo near line 1, column 309 [select brand from cn.webstudio.bean.McurwDataCampaignBrand as brand INNER JOIN brand.mcurwDataTeam as team INNER JOIN brand.mcurwRelationshipCampaignBrandAndModels bam INNER JOIN brand.mcurwRelationshipCampaignBrandAndModels.mcurwDataModel as mo where 1=1 and team.teamName= ? and brand.campaignEndTime>= ? mo.amodelName= ? and brand.campaignStartTime<= ? ]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: mo near line 1, column 309 [select brand from cn.webstudio.bean.McurwDataCampaignBrand as brand INNER JOIN brand.mcurwDataTeam as team INNER JOIN brand.mcurwRelationshipCampaignBrandAndModels bam INNER JOIN brand.mcurwRelationshipCampaignBrandAndModels.mcurwDataModel as mo where 1=1 and team.teamName= ? and brand.campaignEndTime>= ? mo.amodelName= ? and brand.campaignStartTime<= ? ]rn at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:657)rn at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)rn at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)rn at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)rn at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:921)rn at cn.webstudio.dao.impl.McurwDataCampaignBrandDaoImpl.findByPropertys(McurwDataCampaignBrandDaoImpl.java:229)rn at cn.webstudio.service.impl.CampaignServiceImpl.findByCondition(CampaignServiceImpl.java:150)rn at Test.Test.main(Test.java:28)rnCaused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: mo near line 1, column 309 [select brand from cn.webstudio.bean.McurwDataCampaignBrand as brand INNER JOIN brand.mcurwDataTeam as team INNER JOIN brand.mcurwRelationshipCampaignBrandAndModels bam INNER JOIN brand.mcurwRelationshipCampaignBrandAndModels.mcurwDataModel as mo where 1=1 and team.teamName= ? and brand.campaignEndTime>= ? mo.amodelName= ? and brand.campaignStartTime<= ? ]rn at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)rn at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:244)rn at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155)rn at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)rn at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:75)rn at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:54)rn at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)rn at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)rn at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)rn at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583)rn at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:923)rn at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)rn ... 5 morernCaused by: line 1:309: unexpected token: morn at org.hibernate.hql.antlr.HqlBaseParser.primaryExpression(HqlBaseParser.java:1038)rn at org.hibernate.hql.antlr.HqlBaseParser.atom(HqlBaseParser.java:3422)rn at org.hibernate.hql.antlr.HqlBaseParser.unaryExpression(HqlBaseParser.java:3200)rn at org.hibernate.hql.antlr.HqlBaseParser.multiplyExpression(HqlBaseParser.java:3082)rn at org.hibernate.hql.antlr.HqlBaseParser.additiveExpression(HqlBaseParser.java:2802)rn at org.hibernate.hql.antlr.HqlBaseParser.relationalExpression(HqlBaseParser.java:2667)rn at org.hibernate.hql.antlr.HqlBaseParser.equalityExpression(HqlBaseParser.java:2449)rn at org.hibernate.hql.antlr.HqlBaseParser.negatedExpression(HqlBaseParser.java:2413)rn at org.hibernate.hql.antlr.HqlBaseParser.logicalAndExpression(HqlBaseParser.java:2341)rn at org.hibernate.hql.antlr.HqlBaseParser.logicalOrExpression(HqlBaseParser.java:2296)rn at org.hibernate.hql.antlr.HqlBaseParser.expression(HqlBaseParser.java:2082)rn at org.hibernate.hql.antlr.HqlBaseParser.logicalExpression(HqlBaseParser.java:1858)rn at org.hibernate.hql.antlr.HqlBaseParser.whereClause(HqlBaseParser.java:454)rn at org.hibernate.hql.antlr.HqlBaseParser.queryRule(HqlBaseParser.java:708)rn at org.hibernate.hql.antlr.HqlBaseParser.selectStatement(HqlBaseParser.java:296)rn at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:159)rn at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:238)rn ... 15 morernrnrnrn我这有4个表 rn一个是车型活动表 还有一个车型表 一个车型表和活动表的中间表 还有一个组表rn因为一个活动可以有多个车型 我就弄了一个中间表rn中间表只有三个字段 本表id ,车型id (外键)和活动Id(外键)rnrn也就是活动表有一个主键 中间表两个外键一个主键 车型表一个主键rnrn还有一个组表 没什么用 我就不贴了rn活动类Xmlrn[code=XML]rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn 活动归属组的IDrn rn rn rn rn 活动开始时间rn rn rn rn rn 活动结束时间rn rn rn rn rn rn 活动IDrn rn rn rn rn rnrnrn[/code]rnrn中间表xmlrnrn[code=XML]rnrnrnrnrn rn rn rn rn rn rn rn 活动IDrn rn rn rn rn 车型IDrn rn rn rnrnrn[/code]rnrn车型xmlrn[code=XML]rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn 车型IDrn rn rn rn rn rn rn rn 车型IDrn rn rn rn rn rnrnrn[/code]rnrn我拼写了hql语句是这样的rnselect brand from McurwDataCampaignBrand as brand INNER JOIN brand.mcurwDataTeam as team INNER JOIN brand.mcurwRelationshipCampaignBrandAndModels bam INNER JOIN brand.mcurwRelationshipCampaignBrandAndModels.mcurwDataModel as mo where 1=1 and team.teamName= ? and brand.campaignEndTime>= ? mo.amodelName= ? and brand.campaignStartTime<= ? rnrnrn请问这么写有问题么?rn我写了另一个跟这个差不多的 是正确的,但是这个有一个跟那个不太一样.rn就是那个不需要中间表,这个有中间表的应该怎么操作。rn错误告诉我大概得意思是rnbrand.mcurwRelationshipCampaignBrandAndModels.mcurwDataModel as morn这个mo它说是未知的rn请高手解答,在线等 比较急
line 1:804: unexpected token: 8报错
[img=http://img.my.csdn.net/uploads/201208/29/1346204766_5545.png][/img]rn这个是按月份查询,当我查1-7,10-12月没问题,查8-9月就不行了(后台报错)rnsql语句我放入数据库中可以查到数据rn表示不理解,为什么其他月份可以唯独8,9月不行rnrn[img=http://img.my.csdn.net/uploads/201208/29/1346205111_5613.png][/img]rn报错信息rnrn[img=http://img.my.csdn.net/uploads/201208/29/1346205112_9595.png][/img]rnsql语句
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件