`
woshixushigang
  • 浏览: 562456 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类

mapper.readValue读取null

 
阅读更多

如下代码,这样写不会走catch方法,此方法不报ioExceptioin

 

 try {
            return mapper.readValue(json, new TypeReference<List<String>>() {});  
        } catch (IOException e) {
            // TODO ignore the exception
            e.printStackTrace();
            return null;
        }

 

捕获Exception即可

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics