1. /**
  2. * 4.0以下系统处理掉返回json的BOM头
  3. *
  4. * @param jsonStr
  5. * @return
  6. */
  7. public static String getJson(String jsonStr) {
  8. if (jsonStr != null && jsonStr.startsWith("\ufeff")) {
  9. LogUtil.d(tag, "jsonstr.exist(utf-8.BOM),json="+jsonStr, BaseAppCommon.Isdebug);
  10. // jsonStr = jsonStr.substring(1);
  11. jsonStr = jsonStr.substring(jsonStr.indexOf("{"),
  12. jsonStr.lastIndexOf("}") + 1);
  13. }
  14. return jsonStr;
  15. }

alue of type java.lang.String cannot be converted to JSONObject的更多相关文章

  1. new JSONObject(str)无法解析 报错:org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject

    org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject 解析服务器返回的Jso ...

  2. Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)

    有一次从服务器解析获取到的Json字符串突然报了这个异常,由于这个json是从 php页面上推送过来的,当时就查是不是由于编码问题引起的,所以就上网搜了,网上大部分都是说由于utf-8的bom头引起的 ...

  3. 前台传参数时间类型不匹配:type 'java.lang.String' to required type 'java.util.Date' for property 'createDate'

    springMVC action接收参数: org.springframework.validation.BindException: org.springframework.validation.B ...

  4. javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String

    javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String javax.el.Bean ...

  5. Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx': no matching editors or conversion strategy found

    今天在完成项目的时候遇到了下面的异常信息: 04-Aug-2014 15:49:27.894 SEVERE [http-apr-8080-exec-5] org.apache.catalina.cor ...

  6. Spring mvc 报错:No qualifying bean of type [java.lang.String] found for dependency:

    具体错误: No qualifying bean of type [java.lang.String] found for dependency: expected at least 1 bean w ...

  7. spring mvc出现 Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'endtime'

    在使用spring mvc中,绑定页面传递时间字符串数据给Date类型是出错: Failed to convert property value of type [java.lang.String] ...

  8. spring3+struts2+hibernate3整合出现的问题,No mapping found for dependency [type=java.lang.String, name='struts.objectFactory.spring.enableAopSupport']

    七月 11, 2016 3:49:24 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule ...

  9. The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files

    最近在做J2ME开发项目,配置环境一切OK,但是打开项目时某些文件提示: The type java.lang.String cannot be resolved. It is indirectly ...

随机推荐

  1. git 操作大全

    Git 以下内容整理自廖雪峰的git教程,主要用于个人方便使用git命令 git忽略已经被纳入版本库的文件 使用 git update-index –-skip-worktree [file] 可以实 ...

  2. shell 中awk、if while 例子

    1.if while命令写在一行中while read a b;do echo $a $b;done < aa.txt12 13 14cat aa.txt12 13 14if [[ $i -eq ...

  3. 三年程序学习之二:(对web初认识)

    接着上一篇讲,之后第二天我就来公司上班了,主要是前端,CSS+DIV,table,网站维护之类的,这样的日子过了将近3个星期,一直没什么进展,自己也学不到什么技术,不过我觉得CSS+DIV我算是基础的 ...

  4. static public和 public static 区别

    static:加static 的是静态成员,不能实例化在你运行的时候他自己在内存中开辟了块空间,不用在new, 有点像全局变量,如果不用你必须去 实例化(new)才能用 static是静态的意思,pu ...

  5. WebSocket with Flask

    转自:https://blog.shonenada.com/post/websocket-with-flask/ WebSocket with Flask HTML5 以前,HTML 还不支持 Web ...

  6. 开源框架DNN简介以及安装

    donetnuke 是一款免费的开源cms框架,目前也有收费版,不过免费版也可以适应大家大部分的需求.我前些阵子是老板让我在20天内,做好一个官网并且发布,并且指定使用dnn这个框架,考虑到又可以学习 ...

  7. 创建被访问的swf文件

    首先创建一个fla文件,名字叫movie.fla,在该文件库中放一个mc, 并将其拖放到舞台上,然后 命名为test_mc, 然后在库中给该mc绑定一个类,类名随意. 创建访问swf文件的swf文件 ...

  8. 40 个顶级 jQuery 图片、内容滑块和幻灯片(转)

    在这个快速发展的网络世界中,我们使用图片.内容滑块和幻灯片来给网站实现良好.有吸引力的外观.你可以吸引浏览者借助图像滑块让网站更加具有活力.使用 JavaScript 可以轻松实现轻量级的图片和内容滑 ...

  9. Office 365 plans, SharePoint Online, and SharePoint 2013 on-premises 功能对比列表

    Andrew ConnellSharePoint大牛整理了一个各个版本SharePoint功能对比列表,是SharePoint相关人员必备资料.赶紧收藏起来. SharePoint 2013 Feat ...

  10. 第三百三十天 how can I 坚持

    今天是姥姥二周年,不是忘了,是根本就没不知道,没放在心上,正月十九,记下了,人这一辈子. 搞不懂,搞不懂那签. 锥地求泉,先难后易,顺其自然,偶遇知己,携手同行,是签文的关键,我逐个解释给你听.锥地求 ...