content: package com.andy.action;
  
  import java.io.IOException;
  import java.io.PrintWriter;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.apache.struts2.ServletActionContext;
  
  import com.andy.service.TeacherService;
  import com.andy.service.TeacherServiceImpl;
  import com.opensymphony.xwork2.ActionSupport;
  
  public class TeacherDeleteAction extends ActionSupport{
  	private TeacherService teacherService = new TeacherServiceImpl();
  	private String tcid;
  
  	public String getTcid() {
  		return tcid;
  	}
  
  	public void setTcid(String tcid) {
  		this.tcid = tcid;
  	}
  	public void delete() throws IOException{
  		HttpServletRequest request = ServletActionContext.getRequest();
  		HttpServletResponse response = ServletActionContext.getResponse();
  		request.setCharacterEncoding("utf-8");
  		response.setCharacterEncoding("utf-8");
  		PrintWriter out = response.getWriter();
  		if(teacherService.deleteTeacher(tcid)){
  			out.print("deleteok");
  		}else{
  			out.print("deletefail");
  		}
  	}
  }
  