map传值

Bear_Grylls Bear_Grylls 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
public void queryDataById(WebContext context) {
HttpServletRequest request = WebcUtils.getRequest(context);
HttpServletResponse response = WebcUtils.getResponse(context);
try {
PrintWriter out = response.getWriter();
String id = request.getParameter("id");
Map<String, Object> map = demoBizc.queryForId(id);
String rs = "{}";
if (map != null && map.size() > 0) {
rs = JSONObject.fromObject(map).toString();
}
out.write(rs);
out.flush();
} catch (Exception e) {
e.printStackTrace();
}
}
为什么可以得到map的值,但是将map的值传给rs时就显示 rs还是等于{}呢?
...全文
评论 5
收藏 已收藏
分享
返回顶部
Bear_Grylls
Java 51,407 成员 86,128 内容