欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JSP中獲取ExtJS.Ajax前臺(tái)傳遞的JSON數(shù)據(jù)實(shí)現(xiàn)過(guò)程

 更新時(shí)間:2013年04月02日 14:23:56   作者:  
JSON數(shù)據(jù)接收的特定過(guò)程必須的數(shù)據(jù)包:commons-lang,commons-beanutils等等,否則JSONObject 報(bào)錯(cuò),并且不能接收,感興趣的朋友可以參考下哈
復(fù)制代碼 代碼如下:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="net.sf.json.*" %>
<%
BufferedReader in=request.getReader();
StringBuffer jsonStr=new StringBuffer();
String str="";
while((str=in.readLine())!=null){
jsonStr.append(str);
}
JSONObject jsonObj= JSONObject.fromObject(jsonStr.toString());
String name= jsonObj.getString("userName");
String pwd= jsonObj.getString("passWord");
String msg="";
if(name.equals("Tom")){
msg="登錄成功";
}else
{
msg="登錄失敗";
}
response.getWriter().write(msg);
%>

JSON數(shù)據(jù)接收的特定過(guò)程。
必須的數(shù)據(jù)包
1.commons-lang.jar
2.commons-beanutils.jar
3.commons-collections.jar
4.commons-logging.jar
5.ezmorph.jar
6.json-lib-2.2.2-jdk15.jar
否則JSONObject 報(bào)錯(cuò),并且不能接收。

相關(guān)文章

最新評(píng)論