- 浏览: 304587 次
- 性别:
- 来自: 江阴
文章分类
最新评论
json.jar 这个东西真难找,提供给大家下载。
并且抄一个例子来学习学习。
例子来源:《Ajax 基础教程》 金灵 等翻译 这本书非常不错。
jsonExample.html
JSONExample.java
web.xml
json2.js
正需要中....
并且抄一个例子来学习学习。
例子来源:《Ajax 基础教程》 金灵 等翻译 这本书非常不错。
jsonExample.html
<html> <head> <title>JSON Example</title> <script type="text/javascript" src="json2.js"></script> <script type="text/javascript"> var xmlHttp; function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } function doJSON() { var car = getCarObject(); var carAsJSON = JSON.stringify(car); alert("Car object as JSON: \n " + carAsJSON); var url = "JSONExample?timeStame=" + new Date().getTime(); createXMLHttpRequest(); xmlHttp.open("POST", url, true); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;"); xmlHttp.send(carAsJSON); } function handleStateChange() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { parseResults(); } } } function parseResults() { var responseDiv = document.getElementById("serverResponse"); if(responseDiv.hasChildNodes()) { responseDiv.removeChild(responseDiv.childNodes[0]); } var responseText = document.createTextNode(xmlHttp.responseText); responseDiv.appendChild(responseText); } function getCarObject() { return new Car("Dodge", "Coronet R/T", 1968, "yellow"); } function Car(make, model, year, color) { this.make = make; this.model = model; this.year = year; this.color = color; } </script> </head> <body> <br /> <br /> <form action="#"> <input type="button" value="Click here to send JSON data to the server" onclick="doJSON();" /> </form> <h2>Server Response:</h2> <div id="serverResponse"></div> </body> </html>
JSONExample.java
package ajaxbook.chap3; import java.io.BufferedReader; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONException; import net.sf.json.JSONObject; public class JSONExample extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String json = readJSONStringFromRequestBody(request); JSONObject jsonObject = null; try { jsonObject = new JSONObject(json); String responseText = "You have a " + jsonObject.getInt("year") + " " + jsonObject.getString("make") + " " + jsonObject.getString("model") + " " + " that is " + jsonObject.getString("color") + " in colors"; response.setContentType("text/xml"); response.getWriter().print(responseText); System.out.println("hello ******* json"); } // catch(ParseException e) { // System.out.println("ParseException: " + e.toString()); // } catch(JSONException e) { System.out.println("JSONException: " + e.toString()); } } private String readJSONStringFromRequestBody(HttpServletRequest request) { StringBuffer json = new StringBuffer(); String line = null; try { BufferedReader reader = request.getReader(); while((line = reader.readLine()) != null) { json.append(line); } } catch(Exception e) { System.out.println("Error reading JSON String: " + e.toString()); } return json.toString(); } }
web.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app id="test"> <display-name>test</display-name> <servlet> <servlet-name>GetAndPostExample</servlet-name> <display-name>GetAndPostExample</display-name> <description></description> <servlet-class>ajaxbook.chap3.GetAndPostExample</servlet-class> </servlet> <servlet> <servlet-name>PostingXMLExample</servlet-name> <display-name>PostingXMLExample</display-name> <description></description> <servlet-class> ajaxbook.chap3.PostingXMLExample</servlet-class> </servlet> <servlet> <servlet-name>JSONExample</servlet-name> <display-name>JSONExample</display-name> <description></description> <servlet-class> ajaxbook.chap3.JSONExample</servlet-class> </servlet> <servlet> <servlet-name>ValidationServlet</servlet-name> <display-name>ValidationServlet</display-name> <description></description> <servlet-class> ajaxbook.chap4.ValidationServlet</servlet-class> </servlet> <servlet> <servlet-name>FCKServlet</servlet-name> <display-name>FCKServlet</display-name> <description></description> <servlet-class> xjh.core.FCKServlet</servlet-class> </servlet> <servlet> <servlet-name>RefreshModelListServlet</servlet-name> <display-name>RefreshModelListServlet</display-name> <description></description> <servlet-class> ajaxbook.chap4.RefreshModelListServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>GetAndPostExample</servlet-name> <url-pattern>/GetAndPostExample</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>PostingXMLExample</servlet-name> <url-pattern>/PostingXMLExample</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>JSONExample</servlet-name> <url-pattern>/JSONExample</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ValidationServlet</servlet-name> <url-pattern>/ValidationServlet</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>FCKServlet</servlet-name> <url-pattern>/FCKServlet</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>RefreshModelListServlet</servlet-name> <url-pattern>/RefreshModelList</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
json2.js
/* http://www.JSON.org/json2.js 2008-11-19 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html This file creates a global JSON object containing two methods: stringify and parse. JSON.stringify(value, replacer, space) value any JavaScript value, usually an object or array. replacer an optional parameter that determines how object values are stringified for objects. It can be a function or an array of strings. space an optional parameter that specifies the indentation of nested structures. If it is omitted, the text will be packed without extra whitespace. If it is a number, it will specify the number of spaces to indent at each level. If it is a string (such as '\t' or ' '), it contains the characters used to indent at each level. This method produces a JSON text from a JavaScript value. When an object value is found, if the object contains a toJSON method, its toJSON method will be called and the result will be stringified. A toJSON method does not serialize: it returns the value represented by the name/value pair that should be serialized, or undefined if nothing should be serialized. The toJSON method will be passed the key associated with the value, and this will be bound to the object holding the key. For example, this would serialize Dates as ISO strings. Date.prototype.toJSON = function (key) { function f(n) { // Format integers to have at least two digits. return n < 10 ? '0' + n : n; } return this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'; }; You can provide an optional replacer method. It will be passed the key and value of each member, with this bound to the containing object. The value that is returned from your method will be serialized. If your method returns undefined, then the member will be excluded from the serialization. If the replacer parameter is an array of strings, then it will be used to select the members to be serialized. It filters the results such that only members with keys listed in the replacer array are stringified. Values that do not have JSON representations, such as undefined or functions, will not be serialized. Such values in objects will be dropped; in arrays they will be replaced with null. You can use a replacer function to replace those with JSON values. JSON.stringify(undefined) returns undefined. The optional space parameter produces a stringification of the value that is filled with line breaks and indentation to make it easier to read. If the space parameter is a non-empty string, then that string will be used for indentation. If the space parameter is a number, then the indentation will be that many spaces. Example: text = JSON.stringify(['e', {pluribus: 'unum'}]); // text is '["e",{"pluribus":"unum"}]' text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' text = JSON.stringify([new Date()], function (key, value) { return this[key] instanceof Date ? 'Date(' + this[key] + ')' : value; }); // text is '["Date(---current time---)"]' JSON.parse(text, reviver) This method parses a JSON text to produce an object or array. It can throw a SyntaxError exception. The optional reviver parameter is a function that can filter and transform the results. It receives each of the keys and values, and its return value is used instead of the original value. If it returns what it received, then the structure is not modified. If it returns undefined then the member is deleted. Example: // Parse the text. Values that look like ISO date strings will // be converted to Date objects. myData = JSON.parse(text, function (key, value) { var a; if (typeof value === 'string') { a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); if (a) { return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6])); } } return value; }); myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { var d; if (typeof value === 'string' && value.slice(0, 5) === 'Date(' && value.slice(-1) === ')') { d = new Date(value.slice(5, -1)); if (d) { return d; } } return value; }); This is a reference implementation. You are free to copy, modify, or redistribute. This code should be minified before deployment. See http://javascript.crockford.com/jsmin.html USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO NOT CONTROL. */ /*jslint evil: true */ /*global JSON */ /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, lastIndex, length, parse, prototype, push, replace, slice, stringify, test, toJSON, toString, valueOf */ // Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. if (!this.JSON) { JSON = {}; } (function () { function f(n) { // Format integers to have at least two digits. return n < 10 ? '0' + n : n; } if (typeof Date.prototype.toJSON !== 'function') { Date.prototype.toJSON = function (key) { return this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'; }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (key) { return this.valueOf(); }; } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { // table of character substitutions '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\' }, rep; function quote(string) { // If the string contains no control characters, no quote characters, and no // backslash characters, then we can safely slap some quotes around it. // Otherwise we must also replace the offending characters with safe escape // sequences. escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function (a) { var c = meta[a]; return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }) + '"' : '"' + string + '"'; } function str(key, holder) { // Produce a string from holder[key]. var i, // The loop counter. k, // The member key. v, // The member value. length, mind = gap, partial, value = holder[key]; // If the value has a toJSON method, call it to obtain a replacement value. if (value && typeof value === 'object' && typeof value.toJSON === 'function') { value = value.toJSON(key); } // If we were called with a replacer function, then call the replacer to // obtain a replacement value. if (typeof rep === 'function') { value = rep.call(holder, key, value); } // What happens next depends on the value's type. switch (typeof value) { case 'string': return quote(value); case 'number': // JSON numbers must be finite. Encode non-finite numbers as null. return isFinite(value) ? String(value) : 'null'; case 'boolean': case 'null': // If the value is a boolean or null, convert it to a string. Note: // typeof null does not produce 'null'. The case is included here in // the remote chance that this gets fixed someday. return String(value); // If the type is 'object', we might be dealing with an object or an array or // null. case 'object': // Due to a specification blunder in ECMAScript, typeof null is 'object', // so watch out for that case. if (!value) { return 'null'; } // Make an array to hold the partial results of stringifying this object value. gap += indent; partial = []; // Is the value an array? if (Object.prototype.toString.apply(value) === '[object Array]') { // The value is an array. Stringify every element. Use null as a placeholder // for non-JSON values. length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || 'null'; } // Join all of the elements together, separated with commas, and wrap them in // brackets. v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']'; gap = mind; return v; } // If the replacer is an array, use it to select the members to be stringified. if (rep && typeof rep === 'object') { length = rep.length; for (i = 0; i < length; i += 1) { k = rep[i]; if (typeof k === 'string') { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } } else { // Otherwise, iterate through all of the keys in the object. for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } } // Join all of the member texts together, separated with commas, // and wrap them in braces. v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}'; gap = mind; return v; } } // If the JSON object does not yet have a stringify method, give it one. if (typeof JSON.stringify !== 'function') { JSON.stringify = function (value, replacer, space) { // The stringify method takes a value and an optional replacer, and an optional // space parameter, and returns a JSON text. The replacer can be a function // that can replace values, or an array of strings that will select the keys. // A default replacer method can be provided. Use of the space parameter can // produce text that is more easily readable. var i; gap = ''; indent = ''; // If the space parameter is a number, make an indent string containing that // many spaces. if (typeof space === 'number') { for (i = 0; i < space; i += 1) { indent += ' '; } // If the space parameter is a string, it will be used as the indent string. } else if (typeof space === 'string') { indent = space; } // If there is a replacer, it must be a function or an array. // Otherwise, throw an error. rep = replacer; if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { throw new Error('JSON.stringify'); } // Make a fake root object containing our value under the key of ''. // Return the result of stringifying the value. return str('', {'': value}); }; } // If the JSON object does not yet have a parse method, give it one. if (typeof JSON.parse !== 'function') { JSON.parse = function (text, reviver) { // The parse method takes a text and an optional reviver function, and returns // a JavaScript value if the text is a valid JSON text. var j; function walk(holder, key) { // The walk method is used to recursively walk the resulting structure so // that modifications can be made. var k, v, value = holder[key]; if (value && typeof value === 'object') { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } } return reviver.call(holder, key, value); } // Parsing happens in four stages. In the first stage, we replace certain // Unicode characters with escape sequences. JavaScript handles many characters // incorrectly, either silently deleting them, or treating them as line endings. cx.lastIndex = 0; if (cx.test(text)) { text = text.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } // In the second stage, we run the text against regular expressions that look // for non-JSON patterns. We are especially concerned with '()' and 'new' // because they can cause invocation, and '=' because it can cause mutation. // But just to be safe, we want to reject all unexpected forms. // We split the second stage into 4 regexp operations in order to work around // crippling inefficiencies in IE's and Safari's regexp engines. First we // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we // replace all simple value tokens with ']' characters. Third, we delete all // open brackets that follow a colon or comma or that begin the text. Finally, // we look to see that the remaining characters are only whitespace or ']' or // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. if (/^[\],:{}\s]*$/. test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { // In the third stage we use the eval function to compile the text into a // JavaScript structure. The '{' operator is subject to a syntactic ambiguity // in JavaScript: it can begin a block or an object literal. We wrap the text // in parens to eliminate the ambiguity. j = eval('(' + text + ')'); // In the optional fourth stage, we recursively walk the new structure, passing // each name/value pair to a reviver function for possible transformation. return typeof reviver === 'function' ? walk({'': j}, '') : j; } // If the text is not JSON parseable, then a SyntaxError is thrown. throw new SyntaxError('JSON.parse'); }; } })();
- json-lib-0.4.jar (34.3 KB)
- 下载次数: 1622
评论
2 楼
kisbo110
2011-02-27
楼主能否给出json2.js的下载链接?找半天了 没找到!官网上也点下不了 不知道咋回事啊
1 楼
Anddy
2009-09-03
正需要中....
发表评论
-
校验输入的日期是否在当前日期一个月以内
2013-07-15 16:15 992<html> <head> ... -
两个页面之间的跳转
2012-12-05 09:54 1262从a.html页面跳转到b.html页面, a.html ... -
javascript 选中select中的某个元素(初学者)
2012-09-17 21:24 996<html> <head> ... -
用javascrip实现两个select互相传递值
2009-07-19 20:18 1292<html> <head> ... -
dynamicLists.html
2009-03-25 23:18 787例子来源:《Ajax 基础教程》 金灵 等译 这本书非常不错 ... -
validation.html
2009-03-25 23:15 726例子来源:《Ajax 基础教程》 金灵 等译 这本书非常不错 ... -
readingResponseHeaders.html
2009-03-25 23:13 955例子来源:《Ajax 基础教程》 金灵 等译 这本书非常不错 ... -
postingXML.html
2009-03-25 23:11 736例子来源:《Ajax 基础教程》 金灵 等译 这本书非常不错 ... -
parsexml.html
2009-03-25 23:08 944例子来源:《Ajax 基础教程》 金灵 等译 这本书非常不错 ... -
innerHTML.html
2009-03-25 23:06 1105例子来源:《Ajax 基础教程》 金灵 等译 这本书非常不错 ... -
getAndPostExample.html
2009-03-25 23:04 1083例子来源:《Ajax 基础教程》 金灵 等译 这本书非常不错 ... -
动态获得xml格式的数据 dynamicContent.html
2009-03-25 23:02 1231dynamicContent.html 例子来源:《Ajax ... -
用javascript实现下拉菜单互动
2007-07-13 17:37 1766js 代码 <html> ... -
在html页面中屏蔽鼠标右键
2007-06-26 10:14 2584屏蔽鼠标右键 oncontextmenu=" ... -
javascript事件列表解说(转载) 选择自 iuhxq 的 Blog
2007-05-18 10:15 1275java ... -
菜单选择改变显示
2006-11-08 14:54 1233<html> <head> ... -
JS判断页面上的单选按钮是否选中
2006-11-07 16:51 14276<html> <head> ... -
用正则表达式控制输入格式
2006-11-02 15:14 1844<html> <head>< ... -
html页面进来要它执行一段JS的方法
2006-11-02 10:26 1985方法一: <html> <head& ...
相关推荐
综上所述,`json.js`、`json2.js`和`json.jar`分别代表了在JavaScript和Java环境下处理JSON数据的工具。理解JSON的语法和使用方法,以及如何在不同环境中适配这些库,对于Web开发和服务器端编程都至关重要。
JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,被广泛用于Web服务和应用程序之间的数据传输。它易于人阅读和编写,同时也易于机器解析和生成。`net.sf.json`是开源项目Apache软件基金会下的一个...
JSON.js和json2.js是两个常见的JavaScript库,用于在JavaScript环境中处理JSON数据。 1. JSON.js:这是一个早期的JSON解析器和字符串化器,主要用于将JavaScript对象转换为JSON字符串,以及将JSON字符串解析为...
2. **导入jar包**:下载完成后,将`json.jar`复制到JMeter的安装目录下的`lib`子目录。这样,JMeter在启动时会自动加载这个库。 3. **配置Beanshell**:在JMeter的测试计划中,添加一个Beanshell组件,如Beanshell ...
JSON,全称JavaScript Object Notation,是一种轻量级的数据交换格式,因其简洁和高效而广泛应用于Web服务和应用程序之间的数据传输。在Java编程环境中,处理JSON数据通常需要借助于特定的库,比如`json.jar`和`org....
JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,被广泛用于Web应用程序之间的数据传输。`org.json`是Java平台上的一个开源库,它提供了一系列API,方便开发者对JSON进行解析、创建和操作。这个资源...
Java JSON.jar.zip是一个压缩包,其中包含了一个名为`java-json.jar`的Java库,这个库主要功能是处理XML和JSON之间的转换。XML(Extensible Markup Language)和JSON(JavaScript Object Notation)是两种广泛用于...
JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,被广泛用于Web应用程序之间传递数据。它基于JavaScript的一个子集,但设计的目标是简洁性和易读性,使得数据的解析和生成都相对简单。JSON格式可以...
2. 可能还有其他依赖的jar包,例如`commons-lang3.jar`(用于语言工具),`commons-beanutils.jar`(用于Bean操作),`commons-collections.jar`(用于集合操作),`ezmorph.jar`(用于对象转换)等,这些都是Json-...
`org.json.jar` 包是Java开发中广泛使用的开源库,主要用于处理JSON(JavaScript Object Notation)数据。JSON是一种轻量级的数据交换格式,因其简洁、易于读写和解析的特性,被广泛应用在Web服务和应用程序之间进行...
JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,被广泛用于Web服务和应用程序之间的数据传输。org.json.jar是Java平台上的一个库,它提供了一系列API,方便开发者处理JSON对象,包括序列化和反序列...
在Java开发中,JSON(JavaScript Object Notation)作为一种轻量级的数据交换格式,被广泛用于服务器与客户端之间的数据传输。为了方便Java开发者处理JSON数据,出现了各种JSON库,其中`org.json.jar`就是一个非常...
这个类库是开源项目JSON.org的一部分,用于在Java应用程序中处理JSON(JavaScript Object Notation)数据格式。JSON是一种轻量级的数据交换格式,广泛应用于Web服务和分布式系统中的数据传输。 描述 ...
`struts2-json-plugin-2.1.8.1.jar` 则是Struts 2框架的一个插件,主要用于增强Struts 2对JSON的支持。Struts 2是一款非常流行的MVC(Model-View-Controller)框架,用于构建企业级的Java Web应用程序。这个插件允许...
在Java中,`org.json.jar`提供了解析和生成JSON的工具,而在JavaScript中,`json.js`(如果是用于旧版浏览器)或者原生的JSON对象用于JSON操作。在JSP开发中,这两个组件可以帮助实现服务器与客户端之间JSON格式的...
JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,被广泛用于Web应用程序之间的数据传输。它以文本形式存储和传递数据,易于人阅读和编写,同时也易于机器解析和生成。JSON.jar文件是针对Java平台的...
JSON-RPC-Java可运行在Servlet容器中如Tomcat也可以运行在JBoss与其它J2EE应用服务器中因此可以在一个基于JavaScript与DHTML的Web应用程序中利用它来直接调用普通Java方法与EJB方法。我们可以很方便的使用JSON-RPC-...
2. **`json.jar`中的主要类和接口**: - `org.json.JSONObject`:表示JSON对象,提供了添加、删除、获取和检查键值对的方法。 - `org.json.JSONArray`:表示JSON数组,可以添加、删除、获取和检查元素。 - `org....
在Java开发中,JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,它使得人和机器都能轻易地读写数据。"net.sf.json.JSONObject"是开源项目json-lib中的一个核心类,它提供了用于处理JSON对象的功能。...
"json jar.zip"这个文件很可能包含了一个或多个用于Java的JSON处理库,比如Jackson、Gson、org.json等。这些库可以帮助开发者将Java对象转换为JSON字符串,或者将JSON字符串反序列化为Java对象,极大地简化了数据...