如果各位人兄已经看完了本文章,您可能已经发现了一个共同点, encodeURI(encodeURI(fontname)),这就是解决问题的方法了,那么就可以进行试试了,希望对您有所帮助,下面就开始对JSON的类库学习吧。

因为我用JAVA开发,所以首先去要下载JSON的类库,我用的是http://www.sf.net提供的json类库。而json类库以信赖于几个其它的类库,JSON的类库下面把所需要的类截个图记录。
写服务器商程序,返回一个JSON格式的数据:
- package cn.limaoyuan.jquery.xml;
 - import java.io.IOException;
 - import java.io.PrintWriter;
 - import javax.servlet.ServletException;
 - import javax.servlet.http.HttpServlet;
 - import javax.servlet.http.HttpServletRequest;
 - import javax.servlet.http.HttpServletResponse;
 - public class JqueryServletForXml extends HttpServlet {
 - public void doGet(HttpServletRequest request, HttpServletResponse response)
 - throws ServletException, IOException {
 - System.out.println("into JqueryServletForXml");
 - response.setContentType("text/xml");
 - response.setCharacterEncoding("gbk");
 - String xml = " version=\"1.0\" encoding=\"gbk\"?><userlist>" +
 - "<user><name>limy_1<age>25_1" +
 - "<user><name>limy_2<age>25_2" +
 - "<user name=\"limy_3\" age=\"25_3\">" +
 - "<user name=\"limy_4\" age=\"25_4\">";
 - response.getWriter().println(xml);
 - }
 - public void doPost(HttpServletRequest request, HttpServletResponse response)
 - throws ServletException, IOException {
 - doGet(request, response);
 - }
 - }
 - 3.其中需要一个User类
 - package cn.limaoyuan.jquery.json;
 - public class User {
 - private String name;
 - private int age;
 - private String address;
 - private String phone;
 - private String mobile;
 - public String getAddress() {
 - return address;
 - }
 - public void setAddress(String address) {
 - this.address = address;
 - }
 - public int getAge() {
 - return age;
 - }
 - public void setAge(int age) {
 - this.age = age;
 - }
 - public String getMobile() {
 - return mobile;
 - }
 - public void setMobile(String mobile) {
 - this.mobile = mobile;
 - }
 - public String getName() {
 - return name;
 - }
 
                分享标题:下载与学习JSON的类库的图记录
                
                网页URL:http://www.csdahua.cn/qtweb/news32/352632.html
            
网站建设、网络推广公司-快上网,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 快上网