⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 updateclientservlet.java

📁 oa rar it is the jsp
💻 JAVA
字号:
package com.accp.oa.control.servlet.client;

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 com.accp.oa.bean.Clientbean;
import com.accp.oa.dao.imple.ClientDAO;
import com.accp.oa.dao.imple.commonDAO;

/**
 * 修改客户信息
 * @author 
 *
 */
public class UpdateClientServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public UpdateClientServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * 在doget方法中进行处理
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		//获得上下文
		String path = request.getContextPath();
		//获得保存在request中的Clientbean的对象
		Clientbean bean = (Clientbean) request.getAttribute("clientsbean");
		ClientDAO client = ClientDAO.getClientDAO();
		commonDAO common = commonDAO.GetcomonDAO();
		int page = common.getpagenumber();
		//进行了修改处理
		if (client.update(bean)) {//成功
			response.sendRedirect(path + "/servlet/SelectClientServlet?num=" + page);
		}
		request.removeAttribute("bean");
	}

	/**
	 * 
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

	/**
	 * Initialization of the servlet. <br>
	 * 
	 * @throws ServletException
	 *             if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -