基于javaweb+jsp的大学生个人财务记账系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
alert("用户名不能为空!");
return false;
}
if (password == "") {
alert("密码不能为空!");
return false;
}
if (password2 != password) {
alert("密码输入不一致!");
return false;
}
return true;
}
</script>
</html>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>收入编辑</title>
<%@ include file="include/head.jsp" %>
</head>
<body>
<div class="form-group">
<label class="col-sm-3 control-label">密码:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="password" name="password">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="realName" name="realName">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">性别:</label>
<div class="col-sm-5">
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@RequestMapping("noticeDelete")
public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");
noticeService.delete(Arrays.asList(id));
this.redirectList(request, response);
}
/**
* 编辑公告
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("noticeEdit")
public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
</div>
<div class="form-group">
<label class="col-sm-3 control-label">金额:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="shouruJinge" name="shouruJinge" value="${vo.shouruJinge}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收入方式:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="shouruFangshi" name="shouruFangshi" value="${vo.shouruFangshi}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">时间:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="shouruTime" name="shouruTime" value="${vo.shouruTime}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-5">
<textarea rows="3" class="form-control" id="shouruText" name="shouruText" placeholder="请输入内容......">${vo.shouruText}</textarea>
Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
String pageNum = Util.decode(request, "pageNum");//封装分页参数
com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
params.put("startIndex", pb.getStartIndex());
params.put("pageSize", pb.getPageSize());
List list = (List) userService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
pb.setServlet("userList");
pb.setSearchColumn(searchColumn);
pb.setKeyword(keyword);
pb.setList(list);
request.getSession().setAttribute("pageBean", pb);
request.getSession().setAttribute("list", pb.getList());
response.sendRedirect("user_list.jsp");
}
}
package com.demo.controller;
userService.insert(vo);
request.getSession().setAttribute("alert_msg", "注册成功!用户名:[" + username + "]");
request.getRequestDispatcher("login.jsp").forward(request, response);
}
@RequestMapping("authLogout")
public void logout(HttpServletResponse response, HttpServletRequest request) throws IOException {
HttpSession session = request.getSession();
User user = (User) session.getAttribute("loginUser");
if (user != null) {
session.removeAttribute("loginUser");
}
response.sendRedirect("login.jsp");
}
@RequestMapping("authValidationCode")
public void validationCode(HttpServletResponse response, HttpServletRequest request) throws IOException {
String codeChars = "0123456789";// 图形验证码的字符集合,系统将随机从这个字符串中选择一些字符作为验证码
// 获得验证码集合的长度
int charsLength = codeChars.length();
// 下面三条记录是关闭客户端浏览器的缓冲区
// 这三条语句都可以关闭浏览器的缓冲区,但是由于浏览器的版本不同,对这三条语句的支持也不同
// 因此,为了保险起见,建议同时使用这三条语句来关闭浏览器的缓冲区
response.setHeader("ragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
// 设置图形验证码的长和宽(图形的大小)
</div>
<div class="form-group">
<label class="col-sm-3 control-label">金额:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="shouruJinge" name="shouruJinge" value="${vo.shouruJinge}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收入方式:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="shouruFangshi" name="shouruFangshi" value="${vo.shouruFangshi}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">时间:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="shouruTime" name="shouruTime" value="${vo.shouruTime}">
</div>
*/
@RequestMapping({"shouruGet", "shouruEditPre"})
public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");//取出主键id
Shouru vo = shouruService.get(id);
request.getSession().setAttribute("vo", vo);
String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
response.sendRedirect("shouru_" + to + ".jsp");
}
/**
* 根据条件查询收入的列表并跳转回页面
*
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>收入编辑</title>
<%@ include file="include/head.jsp" %>
</head>
<body>
<div class="container-fluid">
<ul class="nav nav-tabs">
<li><a href="shouruList">收入列表</a></li>
<li class="active"><a href="#">编辑</a></li>
</ul>
<br/>
<form class="form-horizontal" role="form" action="shouruEdit" method="post" onsubmit="return check()">
return false;
}
return true;
}
function refresh() {
var img = document.getElementById("img_validation_code")
img.src = "authValidationCode?r=" + Math.random();
}
</script>
</html>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
<title>注册</title>
<link rel="stylesheet" href="js/myCss.css">
<script src="js/jquery.min.js"></script>
<script src="js/myJs.js"></script>
<script type="text/javascript">
let alert_msg = '${alert_msg}';
if (alert_msg != null && alert_msg.trim() != '') {
window.alert(alert_msg);
}
</script>
</head>
<body>
<div class="bg"></div>
<div class="container">
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、收入模块、支出模块的增删改查管理