首页>代码>Java web旅游汽车公司车辆管理系统>/che/src/servlet/del12servlet.java
package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import che.dao.impl.chaxunDAOImpl;

public class del12servlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public del12servlet() {
		super();
	}
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request,response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		 request.setCharacterEncoding("UTF-8");
         int zhi =Integer.parseInt(request.getParameter("id"));
         chaxunDAOImpl cha=new chaxunDAOImpl();
         response.setContentType( "text/html;charset=utf-8 ");
         PrintWriter out = response.getWriter();
          try{
             cha.del10(zhi);
             out.print("<script>" + "alert('删除成功!');"+ "document.location.href='../fankuixinxi1.jsp';"+ "</script>");
				out.close();
				return;

          }catch(Exception e){
               System.out.println(e.getMessage()); 
               out.print("<script>" + "alert('删除失败!');"+ "document.location.href='../fankuixinxi1.jsp';"+ "</script>");
				out.close();
				return;
}
	}

	public void init() throws ServletException {
		// Put your code here
	}

}
最近下载更多
微信网友_7000012089643008  LV4 2024年5月26日
微信网友_6050164023693312  LV2 2023年12月27日
刘洋66666  LV1 2023年11月5日
adap12345  LV5 2023年6月15日
berty boom  LV4 2023年6月12日
846488283  LV4 2023年5月29日
泓鼎168  LV20 2023年3月31日
北方菜  LV11 2022年12月30日
2385649653  LV7 2022年11月4日
huwenxuan  LV6 2022年6月22日
最近浏览更多
xiejingxun  LV2 2024年12月31日
微信网友_7294439741132800  LV1 2024年12月13日
Daima000  LV4 2024年12月5日
yimaoermao  LV1 2024年11月28日
joearney  LV1 2024年11月26日
shunlun8855  LV1 2024年10月29日
wuying8208  LV15 2024年10月23日
张泽帅  LV6 2024年10月18日
forkchen 2024年7月24日
暂无贡献等级
TY0165  LV20 2024年6月22日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友