jfinal中的json输出

andying 发布于 2013/12/17 15:00
阅读 1K+
收藏 0

今天测试了一下jfinal的json输出功能,生成json字符如下:

{"blogList":[{"content":"JFinal Demo Content here\r\ngfgd","id":1,"title":"JFinal Demo Title here","authorSex":"男","authorName":"andy","author_id":1},{"content":"test 1\r\nfdfds\r\nfdsfs\r\nfds","id":2,"title":"人生苦短,过好每一天.","authorSex":"男","authorName":"andy","author_id":1},{"content":"test 2","id":3,"title":"健康是福.","authorSex":"女","authorName":"jean","author_id":2},{"content":"test 3","id":4,"title":"test 3","authorSex":"女","authorName":"jean","author_id":2},{"content":"test 4","id":5,"title":"test 4","authorSex":"女","authorName":"jean","author_id":2},{"content":"新的一天开始了,每天进步一点点.\r\ngood framework!","id":6,"title":"新的一天","authorSex":"女","authorName":"jean","author_id":2},{"content":"fsdfsdffsd\r\ngdfsdf","id":8,"title":"dfsd","authorSex":"男","authorName":"andy","author_id":1}]}
其中content字段的值生成包含了一些转义字符,比如回车,换行,请问前台引用这个content的值时,还要再做处理吗?还是直接在前台<textarea>标签中引用即可?
加载中
0
本人纯属虚构
本人纯属虚构

just try it,,,

问问题的时间用来try  早都出结果了 是吧,,,

0
andying
andying
楼上教训的是,后续改正.
0
JFinal
JFinal
不用再做处理,转义本来应该这么做的
返回顶部
顶部