书签 分享 收藏 举报 版权申诉 / 67

类型转账系统Java Web转账系统设计实例版.docx

  • 文档编号:29796425
  • 上传时间:2023-07-27
  • 格式:DOCX
  • 页数:67
  • 大小:1.15MB

 

单击注册按钮

 

 

单击添加账户资金:

进入增加资金界面

3增加资金界面amountMoneyAdd.jsp

<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%>

<%

Stringpath=request.getContextPath();

StringbasePath=request.getScheme()+":

//"+request.getServerName()+":

"+request.getServerPort()+path+"/";

%>

DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">

">

MyJSP'amountMoneyAdd.jsp'startingpage

--

-->

rgb(255,128,64);">增加资金界面


 


  

账户名:


 增加资金:


   

密码:


 

 

 

 

 

 

 

 

再次注册新账户:

如有再次注册则注册失败:

 

 

添加资金20000:

 

 

查询全部账户:

 

核心业务转账功能:

 

4删除界面amountDelete.jsp

 

如果没有账户名,则删除失败!

 

代码如下:

<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%>

<%

Stringpath=request.getContextPath();

StringbasePath=request.getScheme()+":

//"+request.getServerName()+":

"+request.getServerPort()+path+"/";

%>

DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">

">

MyJSP'amountDelete.jsp'startingpage

--

-->

rgb(255,255,128);">

账户删除界面



账户名


 密码

   

 

 

 


 

再次登录账户幽居望竹清风账户不存在:

 

业务Servlet类如下:

 

 

Login.Java登录验证数据库核心类

packageservlet;

importjava.io.IOException;

importjava.io.PrintWriter;

importjavax.servlet.ServletException;

importjavax.servlet.http.HttpServlet;

importjavax.servlet.http.HttpServletRequest;

importjavax.servlet.http.HttpServletResponse;

importjavax.servlet.http.HttpSession;

importpojo.amount;

importdao.amountDao;

 

publicclassloginextendsHttpServlet{

/**

*ThedoGetmethodoftheservlet.

*

*Thismethodiscalledwhenaformhasitstagvaluemethodequalstoget.

*

*@paramrequesttherequestsendbytheclienttotheserver

*@paramresponsetheresponsesendbytheservertotheclient

*@throwsServletExceptionifanerroroccurred

*@throwsIOExceptionifanerroroccurred

*/

publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)

throwsServletException,IOException{

this.doPost(request,response);

}

publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)

throwsServletException,IOException{

request.setCharacterEncoding("UTF-8");

response.setCharacterEncoding("UTF-8");//没有设置编码的话,中文登陆不了

response.setContentType("text/html");

PrintWriterout=response.getWriter();

StringamountName=request.getParameter("amountName");

StringamountPwd=request.getParameter("pwd");

amountam=amountDao.login(amountName,amountPwd);

if(am==null){

response.sendRedirect("login.jsp");

}else{

HttpSessionsession=request.getSession();//得到一个会话

session.setAttribute("amountName",amountName);//会话传递参数

request.getRequestDispatcher("/servlet/amountData").forward(request,response);//页

}

}

}

 

amountAdd账户增加核心业务类

packageservlet;

importjava.io.IOException;

importjava.io.PrintWriter;

importjava.util.ArrayList;

importjava.util.List;

importjavax.servlet.ServletException;

importjavax.servlet.http.HttpServlet;

importjavax.servlet.http.HttpServletRequest;

importjavax.servlet.http.HttpServletResponse;

importpojo.amount;

importdao.amountDao;

publicclassamountAddextendsHttpServlet{

/**

*ThedoGetmethodoftheservlet.

*

*Thismethodiscalledwhenaformhasitstagvaluemethodequalstoget.

*

*@paramrequesttherequestsendbytheclienttotheserver

*@paramresponsetheresponsesendbytheservertotheclient

*@throwsServletExceptionifanerroroccurred

*@throwsIOExceptionifanerroroccurred

*/

publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)

throwsServletException,IOException{

this.doPost(request,response);

}

/**

*ThedoPostmethodoftheservlet.

*

*Thismethodiscalledwhenaformhasitstagvaluemethodequalstopost.

*

*@paramrequesttherequestsendbytheclienttotheserver

*@paramresponsetheresponsesendbytheservertotheclient

*@throwsServletExceptionifanerroroccurred

*@throwsIOExceptionifanerroroccurred

*/

publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)

throwsServletException,IOException{

request.setCharacterEncoding("UTF-8");

response.setCharacterEncoding("UTF-8");

response.setContentType("text/html");

PrintWriterout=response.getWriter();

StringamountName=request.getParameter("amountName");

Stringpwd=request.getParameter("pwd");

List

配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
转账系统Java Web转账系统设计实例版 转账 系统 Java Web 设计 实例
提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:转账系统Java Web转账系统设计实例版.docx
链接地址:https://www.bdocx.com/doc/29796425.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2022 冰点文档网站版权所有

经营许可证编号:鄂ICP备2022015515号-1

收起
展开