JSP课程设计报告

时间:2024.3.31


 the code of login module:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

  <head>

    <base href="<%=basePath%>">

    <title>personal information management system</title>

       <meta http-equiv="pragma" content="no-cache">

       <meta http-equiv="cache-control" content="no-cache">

       <meta http-equiv="expires" content="0">   

       <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

       <meta http-equiv="description" content="This is my page">

       <!--

       <link rel="stylesheet" type="text/css" href="styles.css">

       -->

<%

       request.setCharacterEncoding("GBK") ;

%>

<link rel="stylesheet" href="css/login.css" type="text/css" />

  </head>

  <body background="images\20101127309.jpg">

  <marquee height="100"></marquee><br />

  <div align="center" >

  <br/><br/><br/><br/>

  <jsp:useBean id="login" scope="request" class="benben.check"/>

    <div align="center"  >

    <br/>

  <br/>

   <center><h1>welcome!!!</h1>

    <form action = "check.jsp" method = "post" name = "form1 ">

    <table width="250" border="0">

<tbody><tr>

<td>ID:</td>

<td><input type = "text" name = "userId" id="userId"side="15"maxlength="15"></td></tr>

<tr>

<td>Password:</td>

<td><input type = "password" name = "password" id = "password"side="15"maxlength="15"></td></tr>

<tr>

<td>&nbsp; </td>

<td><input type = "submit" value = "OK" >&nbsp;

 <input type="reset" value="Cancel">&nbsp;

<input type="button" value="Registered" onClick="window.open('zhuce.jsp')"><br></td></tr>

</tbody></table>

    </form>

    (input ID and password in 6~15 digits)

    </center>

    <div class="div1"><table border="0" width="250px">

<tr>

<td height="23px"><%=login.getErrorMsg("erruserId")%></td></tr>

<tr>

<td height="23px"><%=login.getErrorMsg("errpassword")%></td></tr></table></div></div></div>

</body>

</html>

The code of registered module:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>

<%@ page import="java.text.*" %>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>Registered</title>

<link rel="stylesheet" type="text/css" href="../css/base.css">

<script language="javascript" type="text/javascript" src="../js/base.js"></script>

</head>

<body leftmargin="8" topmargin="8">

<!--  快速转换位置按钮  -->

<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">

<tr>

 <td height="26">

  <table width="98%" border="0" cellspacing="0" cellpadding="0">

  <tr>

  <td align="center">

 </td></tr></table></td></tr></table>

<!--  内容列表   -->

<form name="form" action="add_user.jsp" method="post">

<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">

<tr bgcolor="#E7E7E7">

       <td height="24" colspan="10">&nbsp;Registered&nbsp;</td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%"> ID:</td>

    <td align="left"><input type="text" name="userId" />(6~15 digits)</td></tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">ID:</td>

    <td align="left"><input type="text" name="userName" /></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">password:</td>

    <td align="left"><input type="text" name="password" />(6~15 digits)</td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">Age:</td>

    <td align="left"><input type="text" name="uage" /></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">Birth:</td>

    <td align="left"><input type="text" name="ubirthday" />(YYYY-MM-DD)</td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">Phone number:</td>

    <td align="left"><input type="text" name="utelephoto" /></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">QQ:</td>

    <td align="left"><input type="text" name="uqq"/></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">Job:</td>

    <td align="left"><input type="text" name="ujob"/></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">Address:</td>

    <td align="left"><input type="text" name="uworkingPlace"/></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td colspan="2" height="280">

    <textarea rows="10" cols="120" name="uremaks"></textarea>

   </td></tr>

   <tr align="left" bgcolor="#FAFAF1" height="22">

    <td colspan="2" >

    <input type="submit" value="Save">&nbsp;&nbsp;

    <input type="reset" value="Reset">&nbsp;&nbsp;

   </td></tr></table></form>

</body>

</html>

The code of morandum module:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>

<%@ page import="java.text.*" %>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<%String userId = null;%>

<%@ include file="../cookie2.html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>memorandum</title>

<link rel="stylesheet" type="text/css" href="../css/base.css">

<script language="javascript" type="text/javascript" src="../js/base.js"></script>

</head>

<body leftmargin="8" topmargin="8">

<!--  快速转换位置按钮  -->

<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">

<tr>

 <td height="26">

  <table width="98%" border="0" cellspacing="0" cellpadding="0">

  <tr>

  <td align="center">

      <%@ include file="top.jsp"%>

 </td></tr></table></td></tr></table>

<!--  内容列表   -->

<form name="form" action="add_mem.jsp" method="post">

<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">

<tr bgcolor="#E7E7E7">

       <td height="24" colspan="10">&nbsp;Add memorandum&nbsp;</td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">&nbsp;Time&nbsp;:</td>

    <td align="left"><input type="text" name="mtime" value="<%=new SimpleDateFormat("yyyy-M-d HH:mm:ss").format(new Date())%>"/></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">Add time:</td>

    <td align="left"><input type="text" name="maddtime" value="<%=new SimpleDateFormat("yyyy-M-d HH:mm:ss").format(new Date())%>"/></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">&nbsp;Place&nbsp;:</td>

    <td align="left"><input type="text" name="mplace"/></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td colspan="2" height="280">

    <textarea rows="20" cols="120" name="mthings"></textarea>

   </td>

   </tr>

   <tr align="left" bgcolor="#FAFAF1" height="22">

       <td colspan="2" >

    <input type="submit" class="coolbg"value="Save">&nbsp;&nbsp;

    <input type="reset" class="coolbg"value="Reset">&nbsp;&nbsp;

   </td></tr></table></form>

</body>

</html>

The code of address book module:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>

<%@ page import="java.text.*" %>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<%String userId = null;%>

<%@ include file="../cookie2.html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>Add address book</title>

<link rel="stylesheet" type="text/css" href="../css/base.css">

<script language="javascript" type="text/javascript" src="../js/base.js"></script>

</head>

<body leftmargin="8" topmargin="8">

<!--  快速转换位置按钮  -->

<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">

<tr>

 <td height="26">

  <table width="98%" border="0" cellspacing="0" cellpadding="0">

  <tr>

  <td align="center">

      <%@ include file="top.jsp"%>

 </td></tr></table></td></tr></table>

<!--  内容列表   -->

<form name="form" action="add_book.jsp" method="post">

<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">

<tr bgcolor="#E7E7E7">

       <td height="24" colspan="10">&nbsp;new address book&nbsp;</td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">&nbsp;Name&nbsp;:</td>

    <td align="left"><input type="text" name="name" /></td>

    <td width="20%">&nbsp;Sex&nbsp;:</td>

    <td align="left"><input type="radio" name="sex" value="male"checked="checked"/>male<input type="radio" name="sex" value="female"/>female</td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">&nbsp;Relationship&nbsp;:</td>

    <td align="left"><input type="text" name="relation"/></td>

 <td width="20%">Add time:</td>

    <td align="left"><input type="text" name="aaddtime" value="<%=new SimpleDateFormat("yyyy-MM-dd").format(new Date())%>"/>*</td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">&nbsp;Phone number&nbsp;:</td>

    <td align="left"><input type="text" name="telephone" /></td>

    <td width="20%">&nbsp;Q&nbsp;&nbsp;Q&nbsp;:</td>

    <td align="left"><input type="text" name="qq" /></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">Birth:</td>

    <td align="left"><input type="text" name="birthday" value="<%=new SimpleDateFormat("yyyy-MM-dd").format(new Date())%>"/>*</td>

    <td width="20%">&nbsp;Job&nbsp;:</td>

    <td align="left"><input type="text" name="job" /></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">Address:</td>

    <td align="left"><input type="text" name="workingPlace" /></td>

    <td width="20%">&nbsp;City&nbsp;:</td>

    <td align="left"><input type="text" name="city" /></td>

</tr>

   <tr align="left" bgcolor="#FAFAF1" height="22">

    <td colspan="4" >

    <input type="submit" class="coolbg"value="Save">&nbsp;&nbsp;

    <input type="reset" class="coolbg"value="Reset">&nbsp;&nbsp;

   </td></tr></table></form>

</body>

</html>

The code of daily record module:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>

<%@ page import="java.text.*" %>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<%String userId = null;%>

<%@ include file="../cookie2.html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>Daily Record</title>

<link rel="stylesheet" type="text/css" href="../css/base.css">

<script language="javascript" type="text/javascript" src="../js/base.js"></script>

</head>

<body leftmargin="8" topmargin="8">

<!--  快速转换位置按钮  -->

<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">

<tr>

 <td height="26">

  <table width="98%" border="0" cellspacing="0" cellpadding="0">

  <tr>

  <td align="center">

      <%@ include file="top.jsp"%>

 </td></tr></table></td></tr></table>

<!--  内容列表   -->

<form name="form" action="add_diary.jsp" method="post">

<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">

<tr bgcolor="#E7E7E7">

       <td height="24" colspan="10">&nbsp;new daily&nbsp;</td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">title:</td>

    <td align="left"><input type="text" name="atitle" /></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">&nbsp;time&nbsp;:</td>

    <td align="left"><input type="text" name="dtime" value="<%=new SimpleDateFormat("yyyy-MM-dd").format(new Date())%>"/></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td width="20%">&nbsp;place&nbsp;:</td>

    <td align="left"><input type="text" name="dplace"/></td>

</tr>

<tr align="center" bgcolor="#FAFAF1" height="22">

    <td colspan="2" height="280">

    <textarea rows="20" cols="120" name="dthings"></textarea>

   </td>

   </tr>

   <tr align="left" bgcolor="#FAFAF1" height="22">

    <td colspan="2" >

    <input type="submit" class="coolbg"value="Save">&nbsp;&nbsp;

    <input type="reset" class="coolbg"value="Reset">&nbsp;&nbsp;

   </td></tr></table></form>

</body>

</html>

The code of financial management module:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>

<%@ page import="javax.naming.*,javax.sql.DataSource,java.sql.*;" %>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<%String userId = null;%>

<%@ include file="../cookie2.html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

  <head>

    <base href="<%=basePath%>">

        <title>My JSP 'index.jsp' starting page</title>

    <link rel="stylesheet" type="text/css" href="../css/base.css">

<script language="javascript" type="text/javascript" src="../js/base.js"></script> 

       <meta http-equiv="pragma" content="no-cache">

       <meta http-equiv="cache-control" content="no-cache">

       <meta http-equiv="expires" content="0">   

       <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

       <meta http-equiv="description" content="This is my page">

       <!--

       <link rel="stylesheet" type="text/css" href="styles.css">

       -->

  </head>

    <body>

  <marquee height="15"></marquee><br />

    <%

ResultSet rs = null;

Statement st = null;

Connection con = null;

String sql=null;

int n=0;

int n1=0;

int n2=0;

int income=0;

int outcome=0;

int total=0;

try

{

    Context ctx = new InitialContext();

    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/Oracle_DB");

    con = ds.getConnection();

    sql = "select * from fC where userId = '"+userId+"'";

    st = con.createStatement();

    rs = st.executeQuery(sql);  

    while(rs.next()){   

    n++;

    if(rs.getInt("inorout")==1){n1++;income=income+rs.getInt("fmoney");}

    else if(rs.getInt("inorout")==-1){n2++;outcome=outcome+rs.getInt("fmoney");}

    total=total+rs.getInt("inorout")*rs.getInt("fmoney");

    }

}catch(Exception e)

{

e.printStackTrace();

out.print(e.getMessage()+"<br>");

}

finally{

    if(rs!=null)

    rs.close();

    if(st!=null)

    st.close();

    if(con!=null)

    con.close();

}

%>

   <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">

<tr bgcolor="#E7E7E7">

<td>income/expenditure</td>

<td>number</td>

<td>amount</td>

</tr>

<tr bgcolor="#E7E7E7">

<td>income</td>

<td><%=n1 %></td>

<td><%=income %></td>

</tr>

<tr bgcolor="#E7E7E7">

<td>expenditure</td>

<td><%=n2 %></td>

<td><%=outcome %></td>

</tr>

<tr bgcolor="#E7E7E7">

<td>total</td>

<td><%=n %></td>

<td><%=total %></td>

</tr></table>

</body>

</html>

更多相关推荐:
课程设计报告

1课程设计目的课程设计是船舶设计原理课程重要的实践性教学环节是培养学生掌握船舶设计基本原理和能力的技术基础主尺度论证与总布置设计是船舶总体设计的重要组成部分通过课程设计的训练力求使学生实现从学生到船舶设计师的角...

课程设计报告内容

一设计目的1强化上机动手能力在理论和实践的基础上进一步巩固数据结构课程学习的内容掌握工程化软件设计的基本方法2掌握图的创建和应用3掌握迪杰斯特拉以及Prim等基本算法思想4掌握if语句及switch语句的运用方...

课程设计报告

中国计量学院信息工程学院课程设计报告课程设计名称系统设计与仿真课程计二级学院信息工程学院专业班级10电信2班学姓成绩号名1000301232廖壁波指导老师20xx年12月13日中国计量学院信息工程学院课程设计报...

课程设计报告模板

信息科学与工程学院高级语言程序设计课程设计报告学生成绩管理系统学科专业计算机科学与技术班级1301学号指导教师唐郑熠讲师学生二零年月目录目录1设计任务12需求分析121基础功能122扩展功能13系统概要设计13...

课程设计报告

扬州大学数据结构课程设计报告课题名称姓名学院系科班级指导老师日期自来水管架设问题广陵学院陈宏建1一课程设计的题目自来水管理架设问题问题描述若要在扬州大学的八个居民区A区B区C区D区E区F区G区H区之间架设自来水...

课程设计报告

系统软件课程设计时钟中断与进程调度学号姓名指导教师11070319许明秀金雪云20xx年12月一报告摘要进程调度是操作系统十分重要的一个部分在操作系统的设计过程中进程调度和时钟中断形成了密不可分的关系系统时钟定...

课程设计报告

计算机高级语言课程设计报告班级学号姓名蔡路日期学生成绩管理系统19xx3120xx100031020xx年1月18日一课程设计题目与要求实习题目学生成绩管理系统实习内容C语言面向对象的分析与设计基本要求学生成绩...

简易温度控制系统(课设报告)

长安大学单片机课程设计-简易温度控制系统-专业:电气工程及其自动化学号:姓名:指导老师:时间:20##.12.30摘要随着科技的不断进步,在工业生产中温度是常用的被控参数,而采用单片机来对这些被控参数进行控制已…

Java课程设计报告模板

Java程序设计课程设计报告20xx20xx年度第1学期Hannio塔专业学生姓名班级学号指导教师完成日期计算机科学技术网络工程马千里B计算机1021010704213徐森20xx年1月8日Hannoi塔目录目...

计算机网络课程设计报告

计算机网络课程设计报告一.课程设计的题目、目的及要求.........................................................2二.课程设计的内容(分析和设计).....…

软件课程设计报告

任务书北京信息科技大学计算机软件基础课程设计题目从某个源点到其余各顶点的最短路径学院专业学生姓名班级学号指导老师起止时间任务书1摘要摘要本次课程设计的问题假设西安北京沈阳武汉4个城市构成小型交通网4个城市表示图...

软件课程设计报告

中南民族大学软件课程设计报告电子信息工程09级题目学生吴雪学号指导教师王锦程电子工程0907100220xx年4月25日简易网络聊天系统摘要计算机网络通信技术已经深入我们的生活并给我们即使通信带来了很大的方随着...

课程设计报告(33篇)