package json.web;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import json.biz.StudentBiz;
import json.entity.Student;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
public class Action extends DispatchAction{
public ActionForward doList(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception{
StudentBiz sb=new StudentBiz();
JSONArray array=JSONArray.fromObject(sb.getList());
PrintWriter out=response.getWriter();
out.write(array.toString());
request.getSession().setAttribute("string", "holle");
return null;
}
public ActionForward toObject(ActionMapping maping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception{
JSONObject jo=JSONObject.fromObject(request.getParameter("newObject"));
System.out.println("userName="+jo.get("username"));
System.out.println("password="+jo.get("password"));
List list=(List) jo.get("aa");
for(int i=0;i<list.size();i++){
System.out.println("list"+(i+1)+"="+list.get(i));
}
return null;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
json.rar (50个子文件)
json
.project 1KB
.settings
.jsdtscope 500B
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.jsdt.ui.superType.name 6B
.mymetadata 285B
WebRoot
WEB-INF
struts-tiles.tld 8KB
.struts-config.mex 480B
web.xml 1KB
struts-config.xml 740B
struts-bean.tld 9KB
struts-nested.tld 70KB
struts-html.tld 72KB
struts-logic.tld 14KB
validator-rules.xml 13KB
lib
ezmorph-1.0.6-sources.jar 67KB
commons-logging.jar 33KB
commons-lang-2.4.jar 256KB
commons-digester.jar 147KB
json-lib-2.3-jdk15-sources.jar 102KB
commons-fileupload.jar 19KB
commons-beanutils.jar 160KB
ezmorph-1.0.6.jar 84KB
ezmorph-1.0.6-javadoc.jar 274KB
commons-beanutils-1.8.2.jar 226KB
json-lib-2.3-jdk15-javadoc.jar 243KB
json-lib-2.3-jdk15.jar 148KB
antlr.jar 344KB
struts.jar 474KB
commons-validator.jar 74KB
morph-1.1.1.jar 286KB
jakarta-oro.jar 62KB
commons-logging-1.1.1.jar 59KB
commons-collections-3.2.1.jar 562KB
classes
com
yourcompany
struts
ApplicationResources.properties 87B
json
biz
StudentBiz.class 2KB
web
Action.class 3KB
ApplicationResources.properties 73B
entity
Student.class 1KB
index.jsp 3KB
META-INF
MANIFEST.MF 39B
js
json2.js 17KB
jquery-1.3.2.js 118KB
index.html 3KB
.myeclipse
src
com
yourcompany
struts
ApplicationResources.properties 87B
json
biz
StudentBiz.java 715B
web
Action.java 1KB
ApplicationResources.properties 73B
entity
Student.java 625B
.mystrutsdata 262B
.classpath 2KB
共 50 条
- 1
fh15802738349
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页