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. UI控件入门

    其实整个学习过程.确实有点儿混乱,因为不懂的东西太多,一会儿看这,一会儿看那,马上就乱了. 还是先做点儿简单的事儿,说控件,但不会说完全,只是入个门,知道怎么学控件,具体要学好每一个控件需要项目中磨练 ...

  2. Flex之HTTPService组件调用

    1.采用<s:HTTPService>标签来实现: <?xml version="1.0" encoding="utf-8"?>< ...

  3. Supports BorlandIDEServices

    Delphi: procedure SetKeystrokeDebugging(Debugging: Boolean); var Dialog: IOTAKeyboardDiagnostics beg ...

  4. cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案

    原文地址 : http://www.cnblogs.com/hhuang2012/p/3336911.html cocos2dx android版本移植时的Error format not a str ...

  5. 可变长参数列表误区与陷阱——va_arg不可接受的类型

    可变长参数列表误区与陷阱--va_arg不可接受的类型 实现一个有可变长参数列表函数的时候,会使用到stdarg.h(这里不讨论varargs.h)中提供的宏. 例如,我们要实现一个简易的my_pri ...

  6. Problems running django-admin

    “command not found: django-admin”¶ django-admin should be on your system path if you installed Djang ...

  7. SharePoint 2013的100个新功能之社交

    一:社会能力 SharePoint 2013引入了一个新东西叫做社会能力,使公司组织中的用户社会化协作.我的网站难以置信地做了改进以集成社会能力.除了我的网站,新的社区网站(新闻提要),关注用户和关注 ...

  8. 如何让label和textblock分成两行

    http://stackoverflow.com/questions/183406/xaml-newline-in-string-attribute http://www.developerfusio ...

  9. MenuStrip菜单递归

    C# TreeView菜单,MenuStrip菜单递归动态生成例子 http://www.cnblogs.com/ajiaojiao0303/articles/1884772.html http:// ...

  10. 【OpenGL】glFinish()和glFlush()函数详解-[转]

    通常情况下,OpenGL指令不是立即执行的.它们首先被送到指令缓冲区,然后才被送到硬件执行.glFinish和glFlush都是强制将命令缓冲区的内容提交给硬件执行. 一.glFinish()函数   ...