<global-results>
<result type="json">
<param name="root">resultObj</param>
</result>
</global-results>
<action name="getAllDeptinfo" class="com.sf.action.DeptAction"
method="execute" />
<action name="getAllStaffInfo" class="com.sf.action.StaffAction" />
<action name="getAllCustomerInfo" class="com.sf.action.CustomerAction" />
<action name="getAllProductInfo" class="com.sf.action.ProductAction" />
</package>
Java 部分代码
public String execute() throws Exception {
// List<?> list = new ArrayList();
DeptDS deptDS = (DeptDS) Factory.getInstance("DeptDS");
// list = deptDS.getAllDeptinfo();
String page = request.getParameter("page");
String rows = request.getParameter("rows");
log.debug("------------->page:"+page+" rows:"+rows);
PageBean cut = deptDS.getAllDeptTable(Integer.parseInt(page),Integer.parseInt(rows));
Map<String,Object> map = new HashMap<String,Object>();
map.put("total",cut.getTotal());
map.put("rows",cut.getList());
resultObj = JSONObject.fromObject(map);
log.debug("JSONObject-------->"+resultObj.toString());
return SUCCESS;
}