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

📄 newaccountservlet.java

📁 一个很不错的移动业务简单业务支撑系统
💻 JAVA
字号:
package com.oristand.control;

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 javax.servlet.http.HttpSession;

import com.oristand.dao.InfoDao;
import com.oristand.service.InfoBean;

public class NewAccountServlet extends HttpServlet {

	
	public NewAccountServlet() {
		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 {

		response.setContentType("text/html;charset=gbk");
		InfoDao infodao=new InfoDao();
		InfoBean infobean=new InfoBean();
		HttpSession session=request.getSession();
		
		String Account_ID=(String)session.getAttribute("Account_ID");
		
		String Contact_Person=request.getParameter("name");
		Contact_Person = new String(Contact_Person.getBytes("ISO-8859-1"),"GBK");
		String Contact_Address=request.getParameter("address");
		Contact_Address =new String(Contact_Address.getBytes("ISO-8859-1"),"GBK");
		String banlance=request.getParameter("money");
		boolean flag=infobean.newAccount(Account_ID,Contact_Person,Contact_Address,banlance);
		if(flag){
			System.out.println("新增账户成功");
			request.getRequestDispatcher("NewAccountServlet1?flag=page").forward(request, response);
		}
		
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		this.doGet(request, response);
		
	}

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

}

⌨️ 快捷键说明

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