java把map转成json字符串数组中_写一个toJSON方法将Map

评论

# re: 写一个toJSON方法将Map对象转换成JSON字符串

2012-03-22 15:58

释皇天

你的这个不行,你加一个这个试试。

map.put("attributes", "{url=menu/toMaintain}");

map.put("children", "[{id=102, text=路灯管理-根据局所ID查看配电箱, attributes={url=adminManage/findBoxByBureauId}, checked=true}, {id=103, text=路灯管理-根据局所ID查看道路, attributes={url=adminManage/findWayByBureauId}, checked=true}, {id=104, text=路灯管理-检查是否有双灯头, attributes={url=adminManage/findLampBydisboxId}, checked=true}, {id=101, text=局所管理-异步查询上级局所, attributes={url=bureau/getAllBurears}, checked=true}, {id=1, text=维护人员管理主页, attributes={url=man/tomaintainmanindex}, checked=true}, {id=2, text=维护人员-添加, attributes={url=man/addMan}, checked=true}, {id=3, text=维护人员-删除, attributes={url=man/deleteMan}, checked=true}, {id=4, text=维护人员-修改, attributes={url=man/modifyMan}, checked=true}, {id=5, text=维护人员-查询所有, attributes={url=man/getCurrentPageOfMan}, checked=true}, {id=6, text=维护人员与配电箱关联管理主页, attributes={url=manbox/tomaintainboxindex}, checked=true}, {id=7, text=维护人员与配电箱关联管理-添加, attributes={url=manbox/addMainBox}, checked=true}, {id=8, text=维护人员与配电箱关联管理-删除, attributes={url=manbox/deleteMainBox}, checked=true}, {id=9, text=维护人员与配电箱关联管理-修改, attributes={url=manbox/modifyMainBox}, checked=true}, {id=10, text=维护人员与配电箱关联管理-查询所有, attributes={url=manbox/getCurrentPageOfMainbox}, checked=true}, {id=11, text=配电箱管理-查询所有, attributes={url=box/getBoxes}, checked=true}, {id=22, text=奖励管理主页, attributes={url=encouragement/toencouragement}, checked=true}, {id=23, text=奖励管理-添加, attributes={url=encouragement/addEncouragement}, checked=true}, {id=24, text=奖励管理-删除, attributes={url=encouragement/deleteEncouragement}, checked=true}, {id=25, text=奖励管理-修改, attributes={url=encouragement/modifyEncouragement}, checked=true}, {id=26, text=奖励管理-查询所有, attributes={url=encouragement/getCurrentPageOfEncouragement}, checked=true}, {id=27, text=维护工单管理主页, attributes={url=dispatch/todispatch}, checked=true}, {id=28, text=维护工单管理-添加, attributes={url=dispatch/addDispatch}, checked=true}, {id=29, text=维护工单管理-删除, attributes={url=dispatch/deleteDispatch}, checked=true}, {id=30, text=维护工单管理-修改, attributes={url=dispatch/modifyDispatch}, checked=true}, {id=31, text=维护工单管理-按id修改, attributes={url=dispatch/modifyByIdDispatch}, checked=true}, {id=32, text=维护工单管理-查询所有, attributes={url=dispatch/getCurrentPageOfDispatch}, checked=true}, {id=33, text=维护工单管理-按id查询, attributes={url=dispatch/getByIdDispatch}, checked=true}, {id=34, text=工程验收管理主页, attributes={url=projectm/toprojectm}, checked=true}, {id=35, text=工程验收管理-添加, attributes={url=projectm/addProjectm}, checked=true}, {id=36, text=工程验收管理-删除, attributes={url=projectm/deleteProjectm}, checked=true}, {id=37, text=工程验收管理-修改, attributes={url=projectm/modifyPMAction}, checked=true}, {id=38, text=工程验收管理-查询所有, attributes={url=projectm/getCurrentPageOfProjectm}, checked=true}, {id=58, text=局所管理主页, attributes={url=bureau/tobureauindex}, checked=true}, {id=59, text=局所管理-添加, attributes={url=bureau/saveBureau}, checked=true}, {id=60, text=局所管理-删除, attributes={url=bureau/deleteBureau}, checked=true}, {id=61, text=局所管理-修改, attributes={url=bureau/updateBureau}, checked=true}, {id=62, text=局所管理-查询所有, attributes={url=bureau/getAllBur}, checked=true}, {id=63, text=局所管理-查询id、nane, attributes={url=bureau/getBureauIdAndName}, checked=true}, {id=64, text=局所管理-查询上级局所, attributes={url=bureau/getUpperBureaus}, checked=true}, {id=65, text=配电箱管理主页, attributes={url=disbox/todisboxindex}, checked=true}, {id=66, text=配电箱管理-添加, attributes={url=disbox/saveDistributionBox}, checked=true}, {id=67, text=配电箱管理-删除, attributes={url=disbox/deleteDistributionBox}, checked=true}, {id=68, text=配电箱管理-修改, attributes={url=disbox/updateDistributionBox}, checked=true}, {id=69, text=配电箱管理-查询所有, attributes={url=disbox/getAllDisbox}, checked=true}, {id=70, text=路灯管理主页, attributes={url=lamp/tolampindex}, checked=true}, {id=71, text=路灯管理-添加, attributes={url=lamp/saveLamp}, checked=true}, {id=72, text=路灯管理-删除, attributes={url=lamp/deleteLamp}, checked=true}, {id=73, text=路灯管理-修改, attributes={url=lamp/updateLamp}, checked=true}, {id=74, text=路灯管理-查询所有, attributes={url=lamp/getAllLamps}, checked=true}]");

回复  更多评论

# re: 写一个toJSON方法将Map对象转换成JSON字符串

2012-03-22 15:59

释皇天

就是,如果mao.put("str","这里如果是个数组,或者map就不行了。")  回复  更多评论

# re: 写一个toJSON方法将Map对象转换成JSON字符串

2013-04-15 14:13

xiocun

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值