转账系统设计——Servlet技术JavaBean技术Jsp技术精品资料.doc
《转账系统设计——Servlet技术JavaBean技术Jsp技术精品资料.doc》由会员分享,可在线阅读,更多相关《转账系统设计——Servlet技术JavaBean技术Jsp技术精品资料.doc(106页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 转账系统设计 Servlet技术 JavaBean技术 Jsp技术 Java web 转账系统设计完整代码 1,登陆界面:login.jsp代码如下: base href= My JSP login.jsp starting page !- 欢迎进入账户登陆界面! 账户名: 密码: 2,注册界面amountAdd.jsp代码如下: base href= My JSP amountAdd.jsp starting page !- 注 册 新 账 户 界 面 账户名:&n
2、bsp; 密码: 单击注册按钮单击添加账户资金:进入增加资金界面3 增加资金界面amountMoneyAdd.jsp base href= My JSP amountMoneyAdd.jsp starting page !- 增 加 资 金 界 面 账户名: 增加资金: 密码: 再次注册新账户:如有再次注册则注册失败:添加资金20000:查询全部账户:核心业务
3、转账功能:4 删除界面 amountDelete.jsp如果没有账户名,则删除失败!代码如下: base href= My JSP amountDelete.jsp starting page !- 账户删除界面 账户名: 密码: 再次登录账户 幽居望竹清风 账户不存在:业务Servlet类如下:Login.Java 登录验证数据库核心类package servlet;import java.io.IOException;import java.io.PrintWriter;import javax
4、.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.HttpSession;import pojo.amount;import dao.amountDao;public class login extends HttpServlet /* * The doGet method of the
5、 servlet. * * This method is called when a form has its tag value method equals to get. * * param request the request send by the client to the server * param response the response send by the server to the client * throws ServletException if an error occurred * throws IOException if an error occurr
6、ed */public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException this.doPost(request, response);public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException request.setCharacterEncoding(UTF-8); re
7、sponse.setCharacterEncoding(UTF-8);/没有设置编码的话,中文登陆不了 response.setContentType(text/html);PrintWriter out = response.getWriter();String amountName=request.getParameter(amountName);String amountPwd=request.getParameter(pwd);amount am=amountDao.login(amountName, amountPwd);if(am=null)response.sendRedirec
8、t(login.jsp);elseHttpSession session=request.getSession();/得到一个会话 session.setAttribute(amountName, amountName);/会话传递参数 request.getRequestDispatcher(/servlet/amountData).forward(request, response); /页amountAdd 账户增加核心业务类package servlet;import java.io.IOException;import java.io.PrintWriter;import java.
9、util.ArrayList;import java.util.List;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import pojo.amount;import dao.amountDao;public class amountAdd extends HttpServlet /* * The doGe
10、t method of the servlet. * * This method is called when a form has its tag value method equals to get. * * param request the request send by the client to the server * param response the response send by the server to the client * throws ServletException if an error occurred * throws IOException if
11、an error occurred */public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException this.doPost(request, response);/* * The doPost method of the servlet. * * This method is called when a form has its tag value method equals to post. * * param request t
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 转账系统设计Servlet技术JavaBean技术Jsp技术 精品资料 转账 系统 设计 Servlet 技术 JavaBean Jsp 精品 资料
限制150内