@@ -0,0 +1,1066 @@
+package com.soft.web;%0A%0Aimport java.util.ArrayList;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0A%0Aimport org.apache.struts2.interceptor.ServletRequestAware;%0A%0Aimport com.opensymphony.xwork2.ActionSupport;%0Aimport com.soft.bean.GoodsBean;%0Aimport com.soft.dao.GoodsDao;%0A%0Aimport net.sf.json.JSONArray;%0A%0Apublic class LoadAction extends ActionSupport implements ServletRequestAware%7B%0A%09/**%0A%09 *%0A%09 */%0A%09private static final long serialVersionUID = 1L;%0A%09private HttpServletRequest request;%0A%09private String result;%0A%0A%09public String getResult() %7B%0A%09%09return result;%0A%09%7D%0A%09public void setResult(String result) %7B%0A%09%09this.result = result;%0A%09%7D%0A%09@Override%0A%09public void setServletRequest(HttpServletRequest arg0) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09this.request = arg0;%0A%09%7D%0A%09public String execute()%7B%0A%09%09GoodsDao db = new GoodsDao();%0A%09%09ArrayList%3CGoodsBean%3E goodslist = db.loadAll();%0A%09%09//%E5%B0%86map%E5%AF%B9%E8%B1%A1%E8%BD%AC%E6%8D%A2%E6%88%90 json%E7%B1%BB%E5%9E%8B%0A%09%09JSONArray json = JSONArray.fromObject(goodslist);%0A%09%09//%E7%BB%99result%E8%B5%8B%E5%80%BC%EF%BC%8C%E4%BC%A0%E9%80%92%E7%BB%99%E9%A1%B5%E9%9D%A2%0A%09%09result = json.toString();%0A%09%09System.out.println(%22in LoadAction/execute: result: %22+result);%0A%09%09return SUCCESS;%0A%09%7D%0A%7D%0A

add web LoginAction