对jquery的ajax的一个封装
来源:未知 责任编辑:责任编辑 发表时间:2015-03-01 01:36 点击:次
<pre class="java" name="code"><pre class="java" name="code"><pre class="java" name="code">package com.aegon_cnooc.oa.admin.action;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONArray;
import net.sf.json.JSONSerializer;
import net.sf.json.util.JSONUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.aegon_cnooc.framework.base.action.BaseAction;
import com.aegon_cnooc.framework.log.Log;
import com.aegon_cnooc.oa.admin.service.LoginService;
import com.aegon_cnooc.util.LogPathUtil;
/**
*
* @Despcrition:
* @Author: liuxinghui
* @Version: 1.0
* @CreateDate: Jul 12, 2011
*/
public class OnloadEmployeeAction extends BaseAction{
private LoginService loginService;
Log logWrite=new Log();
/**
* 组织架构定义中点击单选按钮获得相应的员工
*/
public ActionForward executeAction(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
logWrite.writeLog(LogPathUtil.getPath(), "start OnloadEmployeeAction...", "info");
String employeeType=request.getParameter("employee_type");
if("all".equals(employeeType)){
//Employees all of company
List employeesAllOfCompany=loginService.getEmployeesAllOfCompany();
logWrite.writeLog(LogPathUtil.getPath(), "Load employeesAllOfCompany employeesAllOfCompany.size():"+employeesAllOfCompany.size(), "info");
JSONArray json = (JSONArray)JSONSerializer.toJSON(employeesAllOfCompany);
response.setContentType("application/json;charset=gbk");
response.setCharacterEncoding("gbk");
PrintWriter pw = response.getWriter();
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONArray;
import net.sf.json.JSONSerializer;
import net.sf.json.util.JSONUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.aegon_cnooc.framework.base.action.BaseAction;
import com.aegon_cnooc.framework.log.Log;
import com.aegon_cnooc.oa.admin.service.LoginService;
import com.aegon_cnooc.util.LogPathUtil;
/**
*
* @Despcrition:
* @Author: liuxinghui
* @Version: 1.0
* @CreateDate: Jul 12, 2011
*/
public class OnloadEmployeeAction extends BaseAction{
private LoginService loginService;
Log logWrite=new Log();
/**
* 组织架构定义中点击单选按钮获得相应的员工
*/
public ActionForward executeAction(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
logWrite.writeLog(LogPathUtil.getPath(), "start OnloadEmployeeAction...", "info");
String employeeType=request.getParameter("employee_type");
if("all".equals(employeeType)){
//Employees all of company
List employeesAllOfCompany=loginService.getEmployeesAllOfCompany();
logWrite.writeLog(LogPathUtil.getPath(), "Load employeesAllOfCompany employeesAllOfCompany.size():"+employeesAllOfCompany.size(), "info");
JSONArray json = (JSONArray)JSONSerializer.toJSON(employeesAllOfCompany);
response.setContentType("application/json;charset=gbk");
response.setCharacterEncoding("gbk");
PrintWriter pw = response.getWriter();
相关新闻>>
- 发表评论
-
- 最新评论 更多>>