springboot项目:家庭整理服务管理系统39774(java+VUE+Mybatis+Maven+Mysql)

一、项目运行

环境配置:

Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。

项目技术:

Springboot + mybatis + Maven + Vue 等等组成,B/S模式 + Maven管理等等。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可

4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目

6.数据库:MySql 5.7/8.0等版本均可;

技术栈

1. 后端:Springboot mybatis

2. 前端:vue+css+javascript+jQuery+easyUI+highcharts

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;

3. 将项目中applicationContext.xml配置文件中的数据库配置改为自己的配置,然后运行;

4. 运行成功后,在浏览器中输入:http://localhost:8080/

 

<%@ page contentType="text/html;charset=GB2312" %>
<%@page language="java" import="java.util.*" import="javax.servlet.http.*" import="myservlet.control.HandleCode"%>
<jsp:useBean id="loginBean" class="mybean.data.Login" scope="session"/>
<HTML>
<title>登录页面</title>
<HEAD>
</HEAD>
<BODY style="background:url(image/放风筝.jpg) ;background-size:cover; ">
<br>
<a href="shouye.jsp"><img src="data:image/箭头.png"/>回到首页</a>
<div align="center">
<br>
<br>
<br>
<FORM action="loginServlet" Method="post" name="loginForm">
登录名称:&nbsp<Input type=text name="logname" onInput="lognameChange()">
<span id="lognameText"></span><span id="loginInfo"></span><br><br>
输入密码:&nbsp<Input type=password name="password" onInput="passwordChange()">
<span id="passwordText"></span><br><br>
验证码:&nbsp&nbsp&nbsp<input type="text" name="code" size="10" onInput="validate()">
<img name="imgValidate" onclick="refresh()" border=0 src="code.jsp"></img>
<span id="codeText" name="codeText" style="color:green"></span><br><br>
<input type="submit" value="提交" style="background:url(imagepath) no-repeat">
<Input type=reset name="g" value="重置" style="background:url(imagepath) no-repeat">
</form></div >
<script type="text/javascript">
function lognameChange(){var str=loginForm.logname.value;var reg=/[a-zA-Z0-9]{4,16}/;if(reg.test(str)){lognameText.innerHTML="√";lognameText.style.color="green";}else{lognameText.innerHTML="账号为4位以上规定字符";lognameText.style.color="red";     }
}
function passwordChange(){var str=loginForm.password.value;var reg=/^[x00-x7f]+$/;if(reg.test(str)&&str.length>4&&str.length<17){passwordText.innerHTML="√";passwordText.style.color="green";}else{passwordText.innerHTML="密码是4位以上字符";passwordText.style.color="red";}
}function refresh(){loginForm.imgValidate.src="code.jsp"+"?id"+Math.random();
}//AJAX
function validate(){var code=loginForm.code.value;var xmlHttp=new XMLHttpRequest();var url="codeServlet?code="+ code;xmlHttp.open("POST", url,true);xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){codeText.innerHTML=xmlHttp.responseText;}else{codeText.innerHTML="正在验证......";}}xmlHttp.send();
}</script>
</BODY>
</HTML>package myservlet.control;
import mybean.data.*;
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;public class HandleLogin extends HttpServlet{public void init(ServletConfig config) throws ServletException {super.init(config);try { Class.forName("com.mysql.jdbc.Driver");}catch(Exception e){} }public String handleString(String s){try{ byte bb[]=s.getBytes("iso-8859-1");s=new String(bb);}catch(Exception ee){} return s;  }public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{Connection con; Statement sql; String logname=request.getParameter("logname").trim(),      //trim() 函数用于去除字符串两端的空白字符。password=request.getParameter("password").trim();logname=handleString(logname);password=handleString(password);String uri="jdbc:mysql://127.0.0.1/toy_db?"+ "user=root&password=123456&characterEncoding=gb2312";boolean boo=(logname.length()>3)&&(password.length()>3);  try{ con=DriverManager.getConnection(uri);String condition="select * from client where logname = '"+logname+"' and password ='"+password+"'";sql=con.createStatement();  if(boo){ResultSet rs=sql.executeQuery(condition);boolean m=rs.next();Code codeBean=null;HttpSession session=request.getSession(true);codeBean=(Code)session.getAttribute("codeBean");String code=codeBean.getCode();if(!code.equals("√")){String backNews="验证码错误!";fail(request,response,logname,backNews);      }else{if(m==true){ //调用登录成功的方法:success(request,response,logname,password); RequestDispatcher dispatcher=request.getRequestDispatcher("/login_sucess.jsp");//转发dispatcher.forward(request,response);}else{String backNews="您输入的用户名不存在,或密码不般配";//调用登录失败的方法:fail(request,response,logname,backNews);                }}}else{String backNews="请输入用户名和密码";fail(request,response,logname,backNews);}con.close();}catch(SQLException exp){String backNews=""+exp;fail(request,response,logname,backNews);}}public  void  doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{doPost(request,response); }public void success(HttpServletRequest request,HttpServletResponse response,String logname,String password) {Login loginBean=null;HttpSession session=request.getSession(true);try{  loginBean=(Login)session.getAttribute("loginBean");if(loginBean==null){loginBean=new Login();  //创建新的数据模型 session.setAttribute("loginBean",loginBean);loginBean=(Login)session.getAttribute("loginBean");}String name =loginBean.getLogname();if(name.equals(logname)) {loginBean.setBackNews(logname+"已经登录了");loginBean.setLogname(logname);}else {  //数据模型存储新的登录用户loginBean.setBackNews(logname+"登录成功");loginBean.setLogname(logname);}}catch(Exception ee){loginBean=new Login();  session.setAttribute("loginBean",loginBean);loginBean.setBackNews(logname+"登录成功");loginBean.setLogname(logname);}}public void fail(HttpServletRequest request,HttpServletResponse response,String logname,String backNews) {response.setContentType("text/html;charset=GB2312");try {PrintWriter out=response.getWriter();out.println("<html><body>");out.println("<h2>"+logname+"登录反馈结果<br>"+backNews+"</h2>") ;out.println("返回登录页面或首页<br>");out.println("<a href =login.jsp>登录页面</a>");out.println("<br><a href =shouye.jsp>首页</a>");out.println("</body></html>");}catch(IOException exp){}}}package mybean.data;
import java.util.*;
import java.util.Date;public class Login {private String logname="",backNews="",password;public void setLogname(String logname){  this.logname = logname;}public String getLogname(){return logname;}public void setPassword(String password){  this.password = password;}public String getPassword(){return password;}public void setBackNews(String s) {backNews = s;} public String getBackNews(){return backNews;}}package mybean.data;public class Code {String code="";public void setCode(String code){  this.code=code;}public String getCode(){  return code;}
}
package net.amag.util;import java.util.ArrayList;import java.util.Collection;import java.util.Vector;public class Paging {/*** 分页* @author Etwo*//** 分页要素:* 1、首页first* 2、最后一页last* 3、页总数pageCount* 4、总共显示的数据条数rowCount* 5、每页显示的数据条数pageRowCount* 6、当前页curPage* 7、得到的数据data*//*** 1、首页first*/private int first;/*** 2、最后一页last*/private int last;/*** 3、页总数pageCount*/private int pageCount;/*** 4、总共显示的数据条数rowCount*/private int rowCount;/*** 5、每页显示的数据条数pageRowCount*/private int pageRowCount;/*** 6、当前页curPage*/private int curPage;/*** 7、得到的数据data*/private Collection data;/*** 默认显示10条数据*/public Paging(Collection data, int curPage) {this.data = data;this.curPage = curPage;this.pageRowCount = 10;this.rowCount = data.size();this.pageCount = (int)Math.ceil((double)this.rowCount / (double)this.pageRowCount);}/*** 自行设置每页显示的条数*/public Paging(Collection data, int curPage, int pageRowCount) {this.data = data;this.curPage = curPage;this.pageRowCount = pageRowCount;this.rowCount = data.size();this.pageCount = (int)Math.ceil((double)this.rowCount / (double)this.pageRowCount);}/*** 首页取得* @return*/public int getFirst() {return this.first = 1;}/*** 最后一页取得* @return*/public int getLast() {return this.last = this.pageCount;}/*** 上一页* @return*/public int previous() {return (this.curPage > 1) ? this.curPage - 1 : 1;}/*** 下一页* @return*/public int next() {return (this.curPage < this.pageCount) ? this.curPage + 1 : this.pageCount;}/*** 判断是否是首页* @return*/public boolean isFirst() {return (this.curPage == 1) ? true : false;}/*** 判断是否是最后一页* @return*/public boolean isLast() {return (this.curPage == this.pageCount) ? true : false;}/*** 当前要显示的数据取得* @return*/public Collection getData() {Collection curData = null;if(data != null) {//定义每一页开始到最后的显示的行数int start, end;start = (this.curPage - 1) * this.pageRowCount;//判断当前显示的数据是否足以显示一整页if(start + this.pageRowCount > this.rowCount) {end = this.rowCount;} else {end = start + this.pageRowCount;}ArrayList arrayData = null;Vector vectorData = null;ArrayList arrayCurData = new ArrayList();Vector vectorCurData = new Vector();boolean isArrayData = true;//判断是属于哪一种集合if(data instanceof ArrayList) {arrayData = (ArrayList)data;isArrayData = true;} else if(data instanceof Vector) {vectorData = (Vector)data;isArrayData = false;}//循环得到每一页的数据for(int i = start; i < end; i++) {if(isArrayData) {arrayCurData.add(arrayData.get(i));} else {vectorCurData.add(vectorData.get(i));}}if(isArrayData) {curData = arrayCurData;} else {curData = vectorCurData;}}return curData;}/*** 客户端显示的工具条*/public String getToolBar(String url) {String str, temp;//用于判断url中是否存在?if(url.indexOf("?") == -1) {temp = "?";} else {temp = "&";}str = "";
str += "";str += "";//判断是否是首页if(isFirst()) {str += "首页 上一页 ";} else {str += "首页 ";str += "上一页 ";}//判断是否是最后一页if(isLast()) {str += "下一页 尾页 ";} else {str += "下一页 ";str += "尾页 ";}str += " 共" + this.rowCount + "条记录 ";str += " 转到";for(int i = 1; i <= this.pageCount; i++) {//判断是否是当前页,若是,则默认为选中当前页if(i == curPage)str += "第" + i + "页";elsestr += "第" + i + "页";}str += "";
return str;}}
/*** 文件上传提供的三个属性*/private String uploadFileName;//文件名称private File upload;//上传文件private String uploadContentType;//文件类型public void setUploadFileName(String uploadFileName) {this.uploadFileName = uploadFileName;}public void setUpload(File upload) {this.upload = upload;}public void setUploadContentType(String uploadContentType) {this.uploadContentType = uploadContentType;}package com.itheima.crm.utils;import java.util.UUID;/*** 文件上传的工具类* @author tycoon**/
public class UploadUtils {/*** 解决目录下文件名重复的问题了* @param fileName* @return*/public static String getUuidFileName(String fileName){int idx=fileName.lastIndexOf(".");//aa.txtString extions=fileName.substring(idx);return UUID.randomUUID().toString().replace("-", "");}/*** 目录分离的方法*/public static String getPath(String uuidFileName){int code1=uuidFileName.hashCode();int d1=code1 & 0xf;//作为一级目录int code2=code1>>>4;int d2=code2 & 0xf;//作为二级目录return "/"+d1+"/"+d2;}
}public String save() throws IOException{//上传图片if(upload!=null){//文件上传//设置文件上传的路径String path="C:/upload";//一个目录下存放相同的文件名:随机文件名String uuidFileName=UploadUtils.getUuidFileName(uploadFileName);//一个目录下存放的文件过多:目录分离String realPath=UploadUtils.getPath(uuidFileName);//创建目录String url=path+realPath;File file=new File(url);if(!file.exists()){file.mkdirs();}//文件上传File dictFile=new File(url+"/"+uuidFileName);FileUtils.copyFile(upload, dictFile);}}

springboot项目:家庭整理服务管理系统39774(java+VUE+Mybatis+Maven+Mysql)相关推荐

  1. Java毕设项目汽车4S服务管理系统(java+VUE+Mybatis+Maven+Mysql)

    Java毕设项目汽车4S服务管理系统(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(W ...

  2. Java毕设项目阿博图书馆管理系统(java+VUE+Mybatis+Maven+Mysql)

    Java毕设项目阿博图书馆管理系统(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(We ...

  3. Java毕设项目师生健康信息管理系统(java+VUE+Mybatis+Maven+Mysql)

    Java毕设项目师生健康信息管理系统(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(W ...

  4. Java毕设项目保险公司风险测评管理系统(java+VUE+Mybatis+Maven+Mysql)

    Java毕设项目保险公司风险测评管理系统(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX ...

  5. JAVA毕设项目外贸服装订单管理系统(java+VUE+Mybatis+Maven+Mysql)

    JAVA毕设项目外贸服装订单管理系统(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(W ...

  6. Java毕设项目家校通管理系统(java+VUE+Mybatis+Maven+Mysql)

    Java毕设项目家校通管理系统(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webs ...

  7. JAVA毕设项目中小型企业资金流管理系统(java+VUE+Mybatis+Maven+Mysql)

    项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclis ...

  8. Springboot毕设项目乐器乐曲交易系统tw5iy(java+VUE+Mybatis+Maven+Mysql)

    Springboot毕设项目乐器乐曲交易系统tw5iy(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HB ...

  9. Springboot毕设项目健康在线服务平台26iy0(java+VUE+Mybatis+Maven+Mysql)

    Springboot毕设项目健康在线服务平台26iy0(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HB ...

  10. springboot毕设项目水族馆观光网站e8iy4(java+VUE+Mybatis+Maven+Mysql)

    springboot毕设项目水族馆观光网站e8iy4(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBu ...

最新文章

  1. Hinton新论文:如何在神经网络中表示“部分-整体层次结构”?
  2. 内存泄露的原因找到了,罪魁祸首居然是 Java TheadLocal
  3. java处理oom_java处理OOM和SOF
  4. 阿里云消息队列 RocketMQ 5.0 全新升级:消息、事件、流融合处理平台
  5. 数字图像处理——中值滤波及其改进算法
  6. Opencv基础画图函数——line、circle、rectangle、Rect、ellipse、polylines、putText函数的用法
  7. 会动的图解 (二) 怎么让goroutine跑一半就退出?
  8. python实现查询mac号对应的OUI厂商信息
  9. PowerShell 扩展工具第二波!
  10. [转]Oracle - 数据库的实例、表空间、用户、表之间关系
  11. 医院的HIS系统简介
  12. Java冒泡排序法 经典例题
  13. mysql 查询父子关系_查询父子关系 · dotnetcore/FreeSql Wiki · GitHub
  14. 读史可以明智_为什么拥抱传统是明智的
  15. 《Maven实战》 读书笔记
  16. 人脸识别——基于CNN的模型实现
  17. 吃透JAVA的Stream流操作,多年实践总结
  18. CPGIS三十周年专访系列|陶闯主席
  19. 达梦数据库启动失败ARCH_DEST[/dmarch] will be out of space.
  20. php 变量 打字费劲,电脑自己打字停不下来

热门文章

  1. C语言进程——进程间的通信方式
  2. portalv15安装 tia_TIA PORTAL V15安装顺序-工业支持中心-西门子中国
  3. 退出mysql控制台与退出mysql
  4. sql语句批量导入数据库数据
  5. 学习写微信小程序(2)
  6. C# 之 垃圾回收机制
  7. java读取Excel指定格式的数据
  8. 笔记本光驱在计算机里不显示器,电脑开机硬盘灯一直亮不闪的 光驱没反应显示器不显示 风扇都转的...
  9. 基于Axure的火车售票系统——高保真原型图
  10. 基于微博评论的文本情感分析与关键词提取的实战案例~