基于javaweb+jsp的大学生个人财务记账系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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…均可

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、收入模块、支出模块的增删改查管理

                            <div class="field field-icon-right"><input type="password" class="input input-big" name="password" id="password" placeholder="登录密码"/><span class="icon icon-key margin-small"></span></div></div><div class="form-group"><div class="field field-icon-right"><input type="password" class="input input-big" name="password2" id="password2" placeholder="确认密码"/><span class="icon icon-key margin-small"></span></div></div></div><div style="padding:30px;"><input type="submit" class="button button-block bg-main text-big input-big" value="注册"></div></div></form></div></div>
</div>
                    <if test ='noticeType != null'>#{noticeType},</if><if test ='createDate != null'>#{createDate}</if></trim></insert><!--批量删除--><delete id="doRemoveBatch" parameterType="java.util.Collection">DELETE FROM `t_notice` WHERE `id` IN<foreach collection="list" item="id" separator="," open="(" close=")">#{id}</foreach></delete><!--修改--><update id="doUpdate" parameterType="com.demo.vo.Notice">UPDATE `t_notice`<set><if test ='id != null'>`id` = #{id},</if><if test ='noticeName != null'>`notice_name` = #{noticeName},</if><if test ='noticeText != null'>`notice_text` = #{noticeText},</if><if test ='noticeType != null'>`notice_type` = #{noticeType},</if><if test ='createDate != null'>`create_date` = #{createDate}</if></set>
            if (!Character.isLetterOrDigit(c)) {if (!isChinese(c)) {count = count + 1;}chLength++;}}return count / chLength > 0.4;}/*** 为防止页面传进来的内容因为编码不同等原因造成乱码,这里作统一的转换** @param parameterName
        if (!loginUser.getPassword().equals(oldPassword)) {msg = "原密码错误!";} else {String newPassword = Util.decode(request, "newPassword");loginUser.setPassword(newPassword);this.userService.update(loginUser);msg = "修改成功!";}request.getSession().setAttribute("alert_msg", msg);request.getRequestDispatcher("reset_password.jsp").forward(request, response);}// 返回一个随机颜色(Color对象)private Color getRandomColor(int minColor, int maxColor) {Random random = new Random();
                    count = count + 1;}chLength++;}}return count / chLength > 0.4;}/*** 为防止页面传进来的内容因为编码不同等原因造成乱码,这里作统一的转换** @param parameterName* @return*/public static String decode(javax.servlet.http.HttpServletRequest request, String parameterName) {String str;if ((str = request.getParameter(parameterName)) == null) {return null;}try {if (isMessyCode(str)) {str = new String(str.getBytes("ISO-8859-1"), "UTF-8");}if (isMessyCode(str)) {
    private int pageSize;//每页显示的数据条数。//需要计算得来private int totalPage;    //总页数,通过totalRecord和pageSize计算可以得来//开始索引,也就是我们在数据库中要从第几行数据开始拿,有了startIndex和pageSize,//就知道了limit语句的两个数据,就能获得每页需要显示的数据了private int startIndex;//分页显示的页数,比如在页面上显示1,2,3,4,5页,start就为1,end就为5,这个也是算过来的private int start;private int end;private String servlet;//查询时要请求的接口private String searchColumn;//待模糊查询的列private String keyword;//待模糊查询的关键字//通过pageNum,pageSize,totalRecord计算得来tatalPage和startIndex,构造方法中将pageNum,pageSize,totalRecord获得public PageBean(int pageNum, int totalRecord) {this.pageNum = (pageNum = Math.max(pageNum, 1));this.pageSize = 10;//默认为10this.totalRecord = totalRecord;//totalPage 总页数if (totalRecord % pageSize == 0) {
response.sendRedirect("shouru_list.jsp");}
}
package com.demo.controller;import com.demo.util.Util;
import com.demo.service.ZhichuService;
import com.demo.vo.Zhichu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
        UPDATE `t_user`<set><if test ='id != null'>`id` = #{id},</if><if test ='username != null'>`username` = #{username},</if><if test ='password != null'>`password` = #{password},</if><if test ='realName != null'>`real_name` = #{realName},</if><if test ='userSex != null'>`user_sex` = #{userSex},</if><if test ='userPhone != null'>`user_phone` = #{userPhone},</if><if test ='userText != null'>`user_text` = #{userText},</if><if test ='userType != null'>`user_type` = #{userType}</if></set>WHERE `id` = #{id}</update><!--获取--><select id="findById" resultMap="BaseResultMap">SELECT <include refid="Base_Column_List" /> FROM `t_user` WHERE `id` = #{id}</select><!--列表--><select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        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) shouruService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果listpb.setServlet("shouruList");pb.setSearchColumn(searchColumn);pb.setKeyword(keyword);pb.setList(list);request.getSession().setAttribute("pageBean", pb);request.getSession().setAttribute("list", pb.getList());response.sendRedirect("shouru_list.jsp");}
}
package com.demo.controller;import com.demo.util.Util;
import com.demo.service.ZhichuService;
import com.demo.vo.Zhichu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
        vo.setUsername(Util.decode(request, "username"));vo.setPassword(Util.decode(request, "password"));vo.setRealName(Util.decode(request, "realName"));vo.setUserSex(Util.decode(request, "userSex"));vo.setUserPhone(Util.decode(request, "userPhone"));vo.setUserText(Util.decode(request, "userText"));vo.setUserType(Util.decode(request, "userType"));//调用Service层的增加(insert)方法userService.insert(vo);this.redirectList(request, response);}/*** 删除用户** @param response* @param request* @throws IOException*/@RequestMapping("userDelete")public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {Serializable id = Util.decode(request, "id");
        vo.setShouruFangshi(Util.decode(request, "shouruFangshi"));vo.setShouruTime(Util.decode(request, "shouruTime"));vo.setShouruText(Util.decode(request, "shouruText"));shouruService.update(vo);this.redirectList(request, response);}/*** 获取收入的详细信息(详情页面与编辑页面要显示该收入的详情)并跳转回页面** @param response* @param request* @throws IOException*/@RequestMapping({"shouruGet", "shouruEditPre"})
        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="container-fluid"><ul class="nav nav-tabs"><li><a href="userList?">用户列表</a></li><li class="active"><a href="#">添加</a></li></ul><br/><form class="form-horizontal" role="form" action="userAdd" method="post" onsubmit="return check()"><div class="form-group"><label class="col-sm-3 control-label">用户名:</label><div class="col-sm-5"><input type="text" class="form-control" id="username" name="username"></div></div>
    //已知数据private int pageNum;//当前页,从请求那边传过来。private int pageSize;//每页显示的数据条数。//需要计算得来private int totalPage;    //总页数,通过totalRecord和pageSize计算可以得来//开始索引,也就是我们在数据库中要从第几行数据开始拿,有了startIndex和pageSize,//就知道了limit语句的两个数据,就能获得每页需要显示的数据了private int startIndex;//分页显示的页数,比如在页面上显示1,2,3,4,5页,start就为1,end就为5,这个也是算过来的private int start;private int end;private String servlet;//查询时要请求的接口private String searchColumn;//待模糊查询的列private String keyword;//待模糊查询的关键字//通过pageNum,pageSize,totalRecord计算得来tatalPage和startIndex,构造方法中将pageNum,pageSize,totalRecord获得public PageBean(int pageNum, int totalRecord) {this.pageNum = (pageNum = Math.max(pageNum, 1));this.pageSize = 10;//默认为10this.totalRecord = totalRecord;
     ** @param c* @return*/private static boolean isChinese(char c) {Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);return (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS|| ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS|| ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A|| ub == Character.UnicodeBlock.GENERAL_PUNCTUATION|| ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION|| ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS);}/*** 判断字符串是否是乱码** @param strName* @return*/public static boolean isMessyCode(String strName) {java.util.regex.Pattern p = java.util.regex.Pattern.compile("\\s*|\t*|\r*|\n*");java.util.regex.Matcher m = p.matcher(strName);
import com.demo.service.ShouruService;
import com.demo.vo.Shouru;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;@Controller
@RequestMapping
public class ShouruController {@Autowiredprivate ShouruService shouruService;/*** 增加收入*














基于javaweb+jsp的大学生个人财务记账系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)相关推荐

  1. 基于javaweb+jsp的大学生个人财务记账系统(JavaWeb MySQL JSP Bootstrap Servlet SSM SpringBoot)

    基于javaweb+jsp的大学生个人财务记账系统(JavaWeb MySQL JSP Bootstrap Servlet SSM SpringBoot) JavaWeb JavaBean JSP M ...

  2. 基于javaweb+jsp的大学生个人财务记账系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

    基于javaweb+jsp的大学生个人财务记账系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax) JavaWeb JavaBean ...

  3. 基于javaweb+jsp的医院住院管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

    基于javaweb+jsp的医院住院管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap) JavaWeb JavaBean JSP MVC ...

  4. 基于javaweb+jsp的个人日记管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

    基于javaweb+jsp的个人日记管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax) 运行环境 Java≥8.MySQL≥5. ...

  5. 基于javaweb+jsp的敬老院养老院管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

    基于javaweb+jsp的敬老院养老院管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap) JavaWeb JavaBean JSP MV ...

  6. 基于javaweb+jsp的敬老院养老院管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

    基于javaweb+jsp的敬老院养老院管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax) JavaWeb JavaBean J ...

  7. 基于javaweb+jsp的设备维修管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

    基于javaweb+jsp的设备维修管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap) JavaWeb JavaBean JSP MVC ...

  8. 基于javaweb+jsp的共享单车管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

    基于javaweb+jsp的共享单车管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax) JavaWeb JavaBean JSP ...

  9. 基于javaweb+jsp的企业物资管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)

    基于javaweb+jsp的企业物资管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax) JavaWeb JavaBean JSP ...

最新文章

  1. phpunit 单元测试案例--签到任务
  2. 软件系统换服务器地址,天正软件客户端修改服务器地址
  3. java向数组中增加新元素_用Java中的新元素替换List的给定索引处的元素
  4. hdu 4496 D-City 并查集
  5. 基于HTML+CSS+JavaScript制作美食文化网站 ——卡通创意的烧烤(5个页面) html静态网页设计制作 dw静态网页成品模板素材网页 web前端网页设计与制作 div静态网页设计
  6. 小程序中插入腾讯视频
  7. 百度地图 3.0 WEB离线开发
  8. 城堡争霸显示服务器忙,城堡争霸 - 阵营守护神显示应用未安装怎么办
  9. 美国弗吉尼亚大学计算机科学,弗吉尼亚大学研究生计算机科学排名关键消息重点总结...
  10. 死亡洞穴(cave)
  11. (Emitted value instead of an instance of Error) postcss-viewport-units:
  12. skycons.js 基于canvas的天气动态图标小插件
  13. 小学计算机课 标语,小学教室的标语
  14. python excel取数 生成报告_python读取excel表格生成erlang数据
  15. 嵌入式状态机编程简介
  16. 自学Python之字符串总结
  17. 360浏览器下载文件成功但文件异常问题
  18. 程序员养花几个实用小技巧
  19. Zigbee协议与开发 - 协调器/路由器节点(EB板)程序结构分析
  20. Cadence设计原理图常用导出方案

热门文章

  1. html 打印 页码 链接,打印html时的页面,打印页码_html_开发99编程知识库
  2. angular官网教程第7个HTTP,找不到angular-in-memory-web-api
  3. 老潘的 PaaS 讲座
  4. ​【JTeam Champion NFT】nft是什么意思?nft概念股又是什么?nft概念股有哪些?​
  5. KubeSphere 虚拟化 KSV 安装体验
  6. 数位 dp 相邻位数字差值的绝对值不能超过 2_XMZD-102 数字温度仪
  7. Kinect nite2 openNI2 配置遇到的问题
  8. python爬虫--正则表达式与Cookie的使用
  9. 大学毕业时找工作的经历
  10. 【前端基础】网页的发展历史