当前位置: 首页 > 编程日记 > 正文

Java项目:家教管理系统(java+SSM+MyBatis+MySQL+Maven+Jsp)

源码获取:博客首页 "资源" 里下载!

该系统分为前台和后台

前台功能有:登录、注册、查看学员、查看教师、个人中心等。

后台功能有:用户管理、学员管理、教师管理、审核管理、公告管理、新闻管理、简历管理等。前台注册分为学员和教师两个角色,学员负责找家教教师、发布需求。教师制作简历供学员选择、联系学员。类似于兼职系统。

本项目如环境一致包运行调试,如有问题可以联系我,右侧有我的联系方式

运行环境:JDK1.8、Mysql5.X、Tomcat7.0/8.5、Maven3.5/3.6、Eclipse

用户管理控制层:

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/users", produces = "text/plain;charset=utf-8")
public class UsersController extends BaseController {// 注入Service 由于标签的存在 所以不需要getter setter@Autowired@Resourceprivate UsersService usersService;// 准备添加数据@RequestMapping("/createUsers")public String createUsers() {return "admin/addusers";}// 添加数据@RequestMapping("/addUsers")public String addUsers(Users users) {this.usersService.insertUsers(users);return "redirect:/users/createUsers";}// 通过主键删除数据@RequestMapping("/deleteUsers")public String deleteUsers(String id) {this.usersService.deleteUsers(id);return "redirect:/users/getAllUsers";}// 批量删除数据@RequestMapping("/deleteUsersByIds")public String deleteUsersByIds() {String[] ids = this.getRequest().getParameterValues("usersid");for (String usersid : ids) {this.usersService.deleteUsers(usersid);}return "redirect:/users/getAllUsers";}// 更新数据@RequestMapping("/updateUsers")public String updateUsers(Users users) {this.usersService.updateUsers(users);return "redirect:/users/getAllUsers";}// 显示全部数据@RequestMapping("/getAllUsers")public String getAllUsers(String number) {List<Users> usersList = this.usersService.getAllUsers();PageHelper.getPage(usersList, "users", null, null, 10, number, this.getRequest(), null);return "admin/listusers";}// 按条件查询数据 (模糊查询)@RequestMapping("/queryUsersByCond")public String queryUsersByCond(String cond, String name, String number) {Users users = new Users();if (cond != null) {if ("username".equals(cond)) {users.setUsername(name);}if ("password".equals(cond)) {users.setPassword(name);}if ("realname".equals(cond)) {users.setRealname(name);}if ("sex".equals(cond)) {users.setSex(name);}if ("birthday".equals(cond)) {users.setBirthday(name);}if ("contact".equals(cond)) {users.setContact(name);}if ("regdate".equals(cond)) {users.setRegdate(name);}}List<String> nameList = new ArrayList<String>();List<String> valueList = new ArrayList<String>();nameList.add(cond);valueList.add(name);PageHelper.getPage(this.usersService.getUsersByLike(users), "users", nameList, valueList, 10, number, this.getRequest(), "query");name = null;cond = null;return "admin/queryusers";}// 按主键查询数据@RequestMapping("/getUsersById")public String getUsersById(String id) {Users users = this.usersService.getUsersById(id);this.getRequest().setAttribute("users", users);return "admin/editusers";}public UsersService getUsersService() {return usersService;}public void setUsersService(UsersService usersService) {this.usersService = usersService;}}

订单管理控制层:

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/orders", produces = "text/plain;charset=utf-8")
public class OrdersController extends BaseController {// 注入Service 由于标签的存在 所以不需要getter setter@Autowired@Resourceprivate OrdersService ordersService;@Autowired@Resourceprivate UsersService usersService;// 准备添加数据@RequestMapping("/createOrders")public String createOrders() {List<Users> usersList = this.usersService.getAllUsers();this.getRequest().setAttribute("usersList", usersList);return "admin/addorders";}// 添加数据@RequestMapping("/addOrders")public String addOrders(Orders orders) {this.ordersService.insertOrders(orders);return "redirect:/orders/createOrders";}// 通过主键删除数据@RequestMapping("/deleteOrders")public String deleteOrders(String id) {this.ordersService.deleteOrders(id);return "redirect:/orders/getAllOrders";}// 批量删除数据@RequestMapping("/deleteOrdersByIds")public String deleteOrdersByIds() {String[] ids = this.getRequest().getParameterValues("ordersid");for (String ordersid : ids) {this.ordersService.deleteOrders(ordersid);}return "redirect:/orders/getAllOrders";}// 更新数据@RequestMapping("/updateOrders")public String updateOrders(Orders orders) {this.ordersService.updateOrders(orders);return "redirect:/orders/getAllOrders";}// 显示全部数据@RequestMapping("/getAllOrders")public String getAllOrders(String number) {List<Orders> ordersList = this.ordersService.getAllOrders();PageHelper.getPage(ordersList, "orders", null, null, 10, number, this.getRequest(), null);return "admin/listorders";}// 按条件查询数据 (模糊查询)@RequestMapping("/queryOrdersByCond")public String queryOrdersByCond(String cond, String name, String number) {Orders orders = new Orders();if (cond != null) {if ("ordercode".equals(cond)) {orders.setOrdercode(name);}if ("usersid".equals(cond)) {orders.setUsersid(name);}if ("total".equals(cond)) {orders.setTotal(name);}if ("addtime".equals(cond)) {orders.setAddtime(name);}if ("status".equals(cond)) {orders.setStatus(name);}if ("address".equals(cond)) {orders.setAddress(name);}if ("contact".equals(cond)) {orders.setContact(name);}if ("workdate".equals(cond)) {orders.setWorkdate(name);}if ("worktime".equals(cond)) {orders.setWorktime(name);}}List<String> nameList = new ArrayList<String>();List<String> valueList = new ArrayList<String>();nameList.add(cond);valueList.add(name);PageHelper.getPage(this.ordersService.getOrdersByLike(orders), "orders", nameList, valueList, 10, number, this.getRequest(), "query");name = null;cond = null;return "admin/queryorders";}// 按主键查询数据@RequestMapping("/getOrdersById")public String getOrdersById(String id) {Orders orders = this.ordersService.getOrdersById(id);this.getRequest().setAttribute("orders", orders);List<Users> usersList = this.usersService.getAllUsers();this.getRequest().setAttribute("usersList", usersList);return "admin/editorders";}public OrdersService getOrdersService() {return ordersService;}public void setOrdersService(OrdersService ordersService) {this.ordersService = ordersService;}}

管理员管理控制层:

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/admin", produces = "text/plain;charset=utf-8")
public class AdminController extends BaseController {// 注入Service 由于标签的存在 所以不需要getter setter@Autowired@Resourceprivate AdminService adminService;// 管理员登录 1 验证用户名是否存在 2 验证密码是否正确@RequestMapping("/login")public String login() {String username = this.getRequest().getParameter("username");String password = this.getRequest().getParameter("password");Admin adminpojo = new Admin();adminpojo.setUsername(username);List<Admin> adminlist = this.adminService.getAdminByCond(adminpojo);if (adminlist.size() == 0) {this.getRequest().setAttribute("message", "用户名不存在");return "admin/index";} else {Admin admin = adminlist.get(0);if (password.equals(admin.getPassword())) {this.getSession().setAttribute("adminid", admin.getAdminid());this.getSession().setAttribute("adminname", admin.getUsername());this.getSession().setAttribute("realname", admin.getRealname());this.getSession().setAttribute("role", admin.getRole());} else {this.getRequest().setAttribute("message", "密码错误");return "admin/index";}}return "admin/main";}// 修改密码@RequestMapping("/editpwd")public String editpwd() {String adminid = (String) this.getSession().getAttribute("adminid");String password = this.getRequest().getParameter("password");String repassword = this.getRequest().getParameter("repassword");Admin admin = this.adminService.getAdminById(adminid);if (password.equals(admin.getPassword())) {admin.setPassword(repassword);this.adminService.updateAdmin(admin);} else {this.getRequest().setAttribute("message", "旧密码错误");}return "admin/editpwd";}// 管理员退出登录@RequestMapping("/exit")public String exit() {this.getSession().removeAttribute("adminid");this.getSession().removeAttribute("adminname");this.getSession().removeAttribute("realname");this.getSession().removeAttribute("role");return "admin/index";}// 准备添加数据@RequestMapping("/createAdmin")public String createAdmin() {return "admin/addadmin";}// 添加数据@RequestMapping("/addAdmin")public String addAdmin(Admin admin) {admin.setAddtime(VeDate.getStringDateShort());this.adminService.insertAdmin(admin);return "redirect:/admin/createAdmin";}// 通过主键删除数据@RequestMapping("/deleteAdmin")public String deleteAdmin(String id) {this.adminService.deleteAdmin(id);return "redirect:/admin/getAllAdmin";}// 批量删除数据@RequestMapping("/deleteAdminByIds")public String deleteAdminByIds() {String[] ids = this.getRequest().getParameterValues("adminid");for (String adminid : ids) {this.adminService.deleteAdmin(adminid);}return "redirect:/admin/getAllAdmin";}// 更新数据@RequestMapping("/updateAdmin")public String updateAdmin(Admin admin) {this.adminService.updateAdmin(admin);return "redirect:/admin/getAllAdmin";}// 显示全部数据@RequestMapping("/getAllAdmin")public String getAllAdmin(String number) {List<Admin> adminList = this.adminService.getAllAdmin();PageHelper.getPage(adminList, "admin", null, null, 10, number, this.getRequest(), null);return "admin/listadmin";}// 按条件查询数据 (模糊查询)@RequestMapping("/queryAdminByCond")public String queryAdminByCond(String cond, String name, String number) {Admin admin = new Admin();if (cond != null) {if ("username".equals(cond)) {admin.setUsername(name);}if ("password".equals(cond)) {admin.setPassword(name);}if ("realname".equals(cond)) {admin.setRealname(name);}if ("contact".equals(cond)) {admin.setContact(name);}if ("role".equals(cond)) {admin.setRole(name);}if ("addtime".equals(cond)) {admin.setAddtime(name);}}List<String> nameList = new ArrayList<String>();List<String> valueList = new ArrayList<String>();nameList.add(cond);valueList.add(name);PageHelper.getPage(this.adminService.getAdminByLike(admin), "admin", nameList, valueList, 10, number, this.getRequest(), "query");name = null;cond = null;return "admin/queryadmin";}// 按主键查询数据@RequestMapping("/getAdminById")public String getAdminById(String id) {Admin admin = this.adminService.getAdminById(id);this.getRequest().setAttribute("admin", admin);return "admin/editadmin";}public AdminService getAdminService() {return adminService;}public void setAdminService(AdminService adminService) {this.adminService = adminService;}}

源码获取:博客首页 "资源" 里下载!

相关文章:

ecshop /api/client/api.php、/api/client/includes/lib_api.php SQL Injection Vul

catalog 1. 漏洞描述 2. 漏洞触发条件 3. 漏洞影响范围 4. 漏洞代码分析 5. 防御方法 6. 攻防思考 1. 漏洞描述 ECShop存在一个盲注漏洞&#xff0c;问题存在于/api/client/api.php文件中&#xff0c;提交特制的恶意POST请求可进行SQL注入攻击&#xff0c;可获得敏感信息或操作…

C++ 检测内存泄露

本文描述了如何检测内存泄露。最主要的是纯C&#xff0c;C的程序如何检测内存泄露。 现在有很多专业的检测工具&#xff0c;比如比较有名的BoundsCheck, 但是这类工具也有他的缺点&#xff0c;我认为首先BoundsCheck是商业软件&#xff0c;呵呵。然后呢需要安装&#xff0c;使用…

Java 学习笔记(4)——java 常见类

上次提前说了java中的面向对象&#xff0c;主要是为了使用这些常见类做打算&#xff0c;毕竟Java中一切都是对象&#xff0c;要使用一些系统提供的功能必须得通过类对象调用方法。其实Java相比于C来说强大的另一个原因是Java中提供了大量可用的标准库 字符串 字符串可以说是任何…

浅谈GCC预编译头技术

浅谈GCC预编译头技术 文/jorge ——谨以此文&#xff0c;悼念我等待MinGW编译时逝去的那些时间。 其 实刚开始编程的时候&#xff0c;我是丝毫不重视编译速度之类的问题的&#xff0c;原因很简单&#xff0c;因为那时我用BASICA。后来一直用到C Builder&#xff0c;尽管Borl…

Java项目:慢病报销管理信息系统(java+MySQL+Jdbc+Servlet+Jsp)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a; 慢病管理&#xff0c;医疗机构管理&#xff0c;家庭管理&#xff0c;费用交纳&#xff0c;费用报销&#xff0c;报表统计等等功能。 二、项目运行 环境配置&#xff1a; Jd…

Jetty Cross Origin Filter解决jQuery Ajax跨域访问的方法

当使用jQuery Ajax post请求时可能会遇到类似这样的错误提示 XMLHttpRequest cannot load http://xxxxxx. Origin http://xxxxxx is not allowed by Access-Control-Allow-Origin. 这是Ajax跨域访问权限的问题&#xff0c;服务器端不接受来自另一个不同IP地址的由脚本文件发出的…

php 遍历所有的文件

<?php prin_r(glob($path)); 2 转载于:https://www.cnblogs.com/zqk8553/p/3640071.html

Oracle数据库物理存储结构管理

1、实验目的 &#xff08;1&#xff09;掌握Oracle数据库数据文件的管理。 &#xff08;2&#xff09;掌握Oracle数据库控制文件的管理。 &#xff08;3&#xff09;掌握Oracle数据库重做日志文件的管理。 &#xff08;4&#xff09;掌握Oracle数据库归档管理。 2、实验环境 Wi…

KDE与GNOME的战争史(转载)

虽然在商业方面存在竞争&#xff0c;GNOME与KDE两大阵营的开发者关系并没有变得更糟&#xff0c;相反他们都意识到支持对方的重要性—如果KDE和GNOME无法实现应用程序的共享&#xff0c;那不仅是巨大的资源浪费&#xff0c;而且将导致Linux出现根本上的分裂。 KDE与GNOME是…

[ActionScript 3.0] AS向php发送二进制数据方法之——在URLRequest中构造HTTP协议发送数据...

主类 HTTPSendPHP.as 1 package 2 {3 import com.JPEGEncoder.JPGEncoder;4 import com.fylib.httpRequest.HttpRequestBuilder;5 import com.fylib.httpRequest.HttpRequestBuilderConsts;6 import flash.display.Bitmap;7 import flash.display.BitmapDa…

Java项目:校园招聘平台系统(java+MySQL+Jdbc+Servlet+SpringMvc+Jsp)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a; 用户和企业用户的注册登录&#xff0c;简历的筛选查看搜索&#xff0c;应聘信息互动等等。 二、项目运行 环境配置&#xff1a; Jdk1.8 Tomcat8.5 mysql Eclispe&#xf…

静态资源(StaticResource)和动态资源(DynamicResource)

静态资源&#xff08;StaticResource&#xff09;和动态资源&#xff08;DynamicResource&#xff09; 资源可以作为静态资源或动态资源进行引用。这是通过使用 StaticResource 标记扩展或 DynamicResource 标记扩展完成的。 StaticResource 通过替换已定义资源的值来为 XAML 属…

如何在 Kaggle 首战中进入前 10%(转)

如何在 Kaggle 首战中进入前 10%&#xff08;转&#xff09; 来源&#xff1a;https://dnc1994.com/2016/04/rank-10-percent-in-first-kaggle-competition/ Introduction 本文采用署名 - 非商业性使用 - 禁止演绎 3.0 中国大陆许可协议进行许可。著作权由章凌豪所有。 Kaggle …

一.Timesten安装

一&#xff0c;安装timesten IMDB并测试 1. 创建数据库相关用户和组 groupadd timestenuseradd -g timesten -G dba timestenpasswd timesten2. 创建相关目录 mkdir /etc/TimesTenchmod 775 /etc/TimesTenchown timesten:timesten /etc/TimesTenmkdir /u01/app/timesTen chmod …

linux 入门-1

刚开始接触linux&#xff0c;总有些简单的问题不知道怎么搞定&#xff0c;先将目前汇总的解决方法叫做"linux入门&#xff0d;1",后续在使用过程中逐步总结。 1. 连接 ADSL &#xff1a; sudo pon dsl-provider 断开 ADSL&#xff1a; sudo poff 查看 ADSL 状态&a…

Java项目:家庭理财系统(java+SSM+JSP+Tomcat8+Mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a;家庭理财&#xff0c;财务分析&#xff0c;统计等等。 二、项目运行 运行环境: jdk8tomcat8mysqlIntelliJ IDEA&#xff08; Eclispe , MyEclispe ,Sts 都支持&#xff0c;代…

ORA-19809: 超出了恢复文件数的限制

实验环境&#xff1a;Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod 实验背景&#xff1a;向tough.t中插入40万条记录&#xff0c;然后rollback&#xff0c;接着执行了shutdown abort命令。当重新启动数据库的时候遇到以下问题。 SQL> alter database …

VC manifest

manifest原理和用途 dll是被动态调用的&#xff0c;所以会被若干个程序共享使用的 但是如果dll在应用程序不知道的情况下升级了、或是被另一个程序更改了&#xff0c;就可能会出现问题&#xff0c;即”DLL Hell” 随着系统资源越来越丰富&#xff0c;硬盘不那么紧张&#xff0…

判断年月日是否正确

//输入年月日 Console.Write("请输入年&#xff1a;"); int year Convert.ToInt32(Console.ReadLine()); Console.Write("请输入月&#xff1a;"); int month Convert.ToInt32(Console.ReadLine()); Console.Write("请输入日&#xff1a;"); i…

Java项目:农业计算工具(java+swing)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 1、换算:吨、千克、斤&#xff0c;晌/公顷、亩、平方米&#xff0c;晌/株、亩/株、平方米/株 2、籽粒干重、果穗干重、出籽率计算 3、发芽种粒数、供试种粒数、发芽率计算 4、种子袋、晌、亩、品种 换算 pac…

web网站加速之CDN(Content Delivery Network)技术原理

2019独角兽企业重金招聘Python工程师标准>>> 在不同地域的用户访问网站的响应速度存在差异,为了提高用户访问的响应速度、优化现有Internet中信息的流动,需要在用户和服务器间加入中间层CDN. 使用户能以最快的速度&#xff0c;从最接近用户的地方获得所需的信息&…

response.getWriter().write()和 response.getWriter().print()的区别

异步上传图片的代码。发现里面用了response.getWriter().print(),故联想到response.getWriter().writer&#xff08;&#xff09;,经过一番api的查找与实操&#xff0c;总结如下&#xff1a; response.getWriter()返回的是PrintWriter&#xff0c;这是一个打印输出流。response…

c语言中volatile关键字的作用

读文章之前 可以先看一下《程序员的自我修养 》第28页 过度优化。 volatile 提醒编译器它后面所定义的变量随时都有可能改变&#xff0c;因此编译后的程序每次需要存储或读取这个变量的时候&#xff0c;都会直接从变量地址中读取数据。如果没有 volatile关键字&#xff0c;则编…

Java项目:抽奖点名神器(HTML+可自定义抽选)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 用于年终抽奖或随机点名神器 //获取页面元素var student_box document.getElementById("student_box");//循环生成HTMLvar html "";for (var i 0 ; i < 22; i ) {html <div st…

Hive Metastore 连接报错

背景 项目中需要通过一些自定义的组件来操控hive的元数据&#xff0c;于是使用了remote方式来存储hive元数据&#xff0c;使用一个服务后台作为gateway&#xff0c;由它来控制hive元数据。 现象 在windows上连接hive metastore的时候&#xff0c;无端的会报NullPointerExceptio…

普通的简单对话框

2019独角兽企业重金招聘Python工程师标准>>> activity_main.xml <LinearLayout xmlns:android"http://schemas.android.com/apk/res/android"xmlns:tools"http://schemas.android.com/tools"android:layout_width"fill_parent"and…

[POI2007]ZAP-Queries

出处&#xff1a;http://www.cnblogs.com/peng-ym/p/8660937.html &#xff08;还是 建议 去看 原文&#xff09; 题目&#xff1a;链接&#xff1a;https://www.luogu.org/problemnew/show/P3455 #include<bits/stdc.h> #define LL long long #define ULL unsigned long…

python pdb 基础调试

当手边没有IDE,面对着python调试犯愁时&#xff0c;你就可以参考下本文&#xff1b;&#xff08;pdb 命令调试&#xff09;参考&#xff1a;http://docs.python.org/library/pdb.html和 (pdb)help首先你选择运行的 pypython -m pdb myscript.py(Pdb) 会自动停在第一行&#xff…

Java项目:设计管理系统(java+SSM+JSP+MYSQL+layui+Maven)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能包括&#xff1a; 课题管理&#xff0c;学生管理&#xff0c;内容管理&#xff0c;文件管理&#xff0c;提问管理&#xff0c;教师管理&#xff0c;进度管理等等。 二、项目运行 环境配置…

linux(以ubuntu为例)下Android利用ant自动编译、修改配置文件、批量多渠道,打包生成apk文件...

原创&#xff0c;转载请注明&#xff1a;http://www.cnblogs.com/ycxyyzw/p/4555328.html 之前写过一篇《windows下Android利用ant自动编译、修改配置文件、批量多渠道&#xff0c;打包生成apk文件》&#xff0c;关于ant打包原理&#xff0c;请先阅读此篇文章&#xff0c;再阅…