`
qq123zhz
  • 浏览: 524419 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

xstream 下划线_问题

    博客分类:
  • java
阅读更多

   最近在使用xtream 1.4.3,出现了如下的问题:

<?xml version="1.0" encoding="GBK"?>
<window cols="3">
	<account name="account10" title="账号_validateRule" allowInput="true" 
	allowInput_account="true"		validateRule="required" allowReadIC="true" allowReadMag="true"/>

</window> 

 allowInput_account="true":当xml属性结点出现_(下划线)时,在解析后发现该属性没有填充到java对应的属性上去。

可以采用:

XStream stream = new XStream(new XppDriver(new
    XmlFriendlyReplacer("_-", "_")));

  解决掉。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics