写在最后
学习技术是一条慢长而艰苦的道路,不能靠一时激情,也不是熬几天几夜就能学好的,必须养成平时努力学习的习惯。所以:贵在坚持!
最后再分享的一些BATJ等大厂20、21年的面试题,把这些技术点整理成了视频和PDF(实际上比预期多花了不少精力),包含知识脉络 + 诸多细节,由于篇幅有限,上面只是以图片的形式给大家展示一部分。
Mybatis面试专题
MySQL面试专题
并发编程面试专题
AdminController
HrefController
LoginController
StudentController
TeachController
四、其他
1.其他系统实现
1.JavaWeb系统系列实现
2.JavaSwing系统系列实现
2.获取源码
3.运行项目
4.备注
5.支持博主
JavaWeb系统系列实现
Java+Springboot+Mybatis+Bootstrap+Maven实现网上商城系统
一、系统介绍
======
1.开发环境
开发工具:IDEA2018.2
JDK版本:jdk1.8
Mysql版本:8.0.13
2.技术选型
后端:Java+Spring+SpringMVC+Mybatis。
前端:Layui+JSP+HTML+CSS。
3.系统功能
登录系统
1.学生
我的成绩:查看个人的成绩。
修改密码:修改系统登录密码。
2.教师
录入成绩:录入和修改学生成绩。
修改密码:修改系统登录密码。
3.管理员
学生管理:对学生信息进行增删改查。
教师管理:对教师信息进行增删改查。
4.数据库
/*
Navicat Premium Data Transfer
Source Server : MySQL
Source Server Type : MySQL
Source Server Version : 80013
Source Host : 127.0.0.1:3306
Source Schema : ssm_score
Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001
Date: 01/09/2021 21:45:11
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
– Table structure for admin
DROP TABLE IF EXISTS admin
;
CREATE TABLE admin
(
id
int(11) NOT NULL AUTO_INCREMENT,
username
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
password
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
PRIMARY KEY (id
) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
– Records of admin
INSERT INTO admin
VALUES (1, ‘admin’, ‘admin’);
– Table structure for student
DROP TABLE IF EXISTS student
;
CREATE TABLE student
(
id
int(11) NOT NULL AUTO_INCREMENT,
username
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
password
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
stuclass
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
stuname
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
stuno
varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
score
double NULL DEFAULT NULL,
PRIMARY KEY (id
) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 22 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
– Records of student
INSERT INTO student
VALUES (8, ‘a’, ‘123456’, ‘1702’, ‘乔乔丫’, ‘1700130222’, 1000);
INSERT INTO student
VALUES (9, ‘b’, ‘123456’, ‘1702’, ‘周瑜’, ‘1700130223’, 100);
INSERT INTO student
VALUES (10, ‘c’, ‘123456’, ‘1703’, ‘曹操’, ‘1700130224’, 6);
INSERT INTO student
VALUES (11, ‘d’, ‘123456’, ‘1704’, ‘小美’, ‘1700130225’, 90);
INSERT INTO student
VALUES (12, ‘e’, ‘123456’, ‘1701’, ‘王菲’, ‘1700130226’, 100);
INSERT INTO student
VALUES (13, ‘f’, ‘123456’, ‘1703’, ‘周杰伦’, ‘1700130227’, NULL);
– Table structure for teacher
DROP TABLE IF EXISTS teacher
;
CREATE TABLE teacher
(
id
int(11) NOT NULL AUTO_INCREMENT,
username
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
password
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
teaname
varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,
PRIMARY KEY (id
) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
– Records of teacher
INSERT INTO teacher
VALUES (3, ‘root’, ‘123456’, ‘李老师’);
INSERT INTO teacher
VALUES (7, ‘a’, ‘123456’, ‘孟老师’);
INSERT INTO teacher
VALUES (5, ‘b’, ‘123456’, ‘赵老师’);
INSERT INTO teacher
VALUES (6, ‘c’, ‘123456’, ‘李老师’);
SET FOREIGN_KEY_CHECKS = 1;
5.工程截图
二、系统展示
=======
1.登录系统
2.学生-主页面
3.学生-我的成绩
4.学生-修改密码
5.教师-主页面
6.教师-录入成绩
7.教师-修改密码
8.管理员-主页面
9.管理员-学生管理-增加学生
10.管理员–学生管理-管理学生
11.管理员-老师管理-增加老师
12.管理员-老师管理-管理老师
三、部分代码
======
AdminController
package com.hhtc.controller;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.hhtc.po.Page;
import com.hhtc.po.Student;
import com.hhtc.po.Teacher;
import com.hhtc.service.AdminService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
public class AdminController {
@Autowired
private AdminService adminService;
@RequestMapping(“/welcome”)
public ModelAndView welcome(Model model) {
ModelAndView mav = new ModelAndView(“admin/welcome”);
return mav;
}
//学生
//学生数据分页
@RequestMapping(value = “/liststudent”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)
@ResponseBody
public String liststudent(Page page) {
List list=adminService.stumanage();
page.caculatestart();
List list2=adminService.liststudent(page);
JSONObject jsonobj=new JSONObject();
jsonobj.put(“code”, 0);
jsonobj.put(“msg”, “成功”);
jsonobj.put(“count”,list.size());
JSONArray jsonobj2=new JSONArray();
JSONObject jsonobj3=new JSONObject();
for(Student student:list2) {
jsonobj3.put(“id”,student.getId());
jsonobj3.put(“username”,student.getUsername());
jsonobj3.put(“password”,student.getPassword());
jsonobj3.put(“stuclass”,student.getStuclass());
jsonobj3.put(“stuname”,student.getStuname());
jsonobj3.put(“stuno”,student.getStuno());
jsonobj2.add(jsonobj3);
}
jsonobj.put(“data”, jsonobj2);
return jsonobj.toString();
}
@RequestMapping(“/addstudent”)
public ModelAndView addstu(Student student,Model model) {
adminService.addStudent(student);
ModelAndView mav = new ModelAndView(“admin/stumanage”);
return mav;
}
@RequestMapping(“/delstu”)
public ModelAndView delstu(String id,Model model) {
adminService.delstudnet(id);
ModelAndView mav = new ModelAndView(“admin/stumanage”);
return mav;
}
@RequestMapping(“/updatestu”)
public ModelAndView updatestu(String id,Student student,Model model) {
student.setId(Integer.parseInt(id));
adminService.updatestu(student);
ModelAndView mav = new ModelAndView(“admin/stumanage”);
return mav;
}
@RequestMapping(value = “/mohuname”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)
@ResponseBody
public String mohuname(HttpSession session) {
@SuppressWarnings(“unchecked”)
List list=(List) session.getAttribute(“list”);
JSONObject jsonobj=new JSONObject();
jsonobj.put(“code”, 0);
jsonobj.put(“msg”, “成功”);
jsonobj.put(“count”,list.size());
JSONArray jsonobj2=new JSONArray();
JSONObject jsonobj3=new JSONObject();
for(Student student:list) {
jsonobj3.put(“id”,student.getId());
jsonobj3.put(“username”,student.getUsername());
jsonobj3.put(“password”,student.getPassword());
jsonobj3.put(“stuclass”,student.getStuclass());
jsonobj3.put(“stuname”,student.getStuname());
jsonobj3.put(“stuno”,student.getStuno());
jsonobj2.add(jsonobj3);
}
jsonobj.put(“data”, jsonobj2);
return jsonobj.toString();
}
//老师
@RequestMapping(“/addtea”)
public ModelAndView addteacher(Teacher teacher,Model model) {
adminService.addteacher(teacher);
ModelAndView mav = new ModelAndView(“admin/teamanage”);
return mav;
}
@RequestMapping(value = “/teamanage”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)
@ResponseBody
public String teamanage(Model model) {
List list=adminService.teamanage();
JSONObject jsonobj=new JSONObject();
jsonobj.put(“code”, 0);
jsonobj.put(“msg”, “成功”);
jsonobj.put(“count”,list.size());
JSONArray jsonobj2=new JSONArray();
JSONObject jsonobj3=new JSONObject();
for(Teacher teacher:list) {
jsonobj3.put(“id”,teacher.getId());
jsonobj3.put(“username”,teacher.getUsername());
jsonobj3.put(“password”,teacher.getPassword());
jsonobj3.put(“teaname”,teacher.getTeaname());
jsonobj2.add(jsonobj3);
}
jsonobj.put(“data”, jsonobj2);
return jsonobj.toString();
}
@RequestMapping(“/deltea”)
public ModelAndView deltea(String id,Model model) {
adminService.delteacher(id);
ModelAndView mav = new ModelAndView(“admin/teamanage”);
return mav;
}
@RequestMapping(“/updatetea”)
public ModelAndView updatetea(String id,Teacher teacher,Model model) {
teacher.setId(Integer.parseInt(id));
adminService.updatetea(teacher);
ModelAndView mav = new ModelAndView(“admin/teamanage”);
return mav;
}
@RequestMapping(value = “/mohunametea”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)
@ResponseBody
public String mohunametea(HttpSession session) {
@SuppressWarnings(“unchecked”)
List list=(List) session.getAttribute(“tealist”);
JSONObject jsonobj=new JSONObject();
jsonobj.put(“code”, 0);
jsonobj.put(“msg”, “成功”);
jsonobj.put(“count”,list.size());
JSONArray jsonobj2=new JSONArray();
JSONObject jsonobj3=new JSONObject();
for(Teacher teacher:list) {
jsonobj3.put(“id”,teacher.getId());
jsonobj3.put(“username”,teacher.getUsername());
jsonobj3.put(“password”,teacher.getPassword());
jsonobj3.put(“teaname”,teacher.getTeaname());
jsonobj2.add(jsonobj3);
}
jsonobj.put(“data”, jsonobj2);
return jsonobj.toString();
}
}
HrefController
package com.hhtc.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.hhtc.po.Student;
import com.hhtc.po.Teacher;
import com.hhtc.service.AdminService;
@Controller
public class HrefController {
@Autowired
private AdminService adminService;
@RequestMapping(“/index”)
public ModelAndView index(Model model) {
ModelAndView mav = new ModelAndView(“index”);
return mav;
}
//学生
@RequestMapping(“/hrefaddstu”)
public ModelAndView addstu(Model model) {
ModelAndView mav = new ModelAndView(“admin/addstu”);
return mav;
}
@RequestMapping(“/hrefmohuname”)
public ModelAndView hrefmohuname(String stuname,Model model,HttpSession session) {
List list=adminService.selectbyname(stuname);
session.setAttribute(“list”, list);
ModelAndView mav = new ModelAndView(“admin/mohuname”);
return mav;
}
@RequestMapping(“/hrefxiustu”)
public String xiustu(String id,Model model) {
Student student=adminService.selectone(id);
model.addAttribute(“student”,student);
return “admin/updatestu”;
}
@RequestMapping(“/hrefstumanage”)
public ModelAndView hrefstumanage(Model model) {
ModelAndView mav = new ModelAndView(“admin/stumanage”);
return mav;
}
//老师
@RequestMapping(“/hrefaddtea”)
public ModelAndView hrefaddtea(Model model) {
ModelAndView mav = new ModelAndView(“admin/addtea”);
return mav;
}
@RequestMapping(“/hrefteamanage”)
public ModelAndView hrefteamanage(Model model) {
ModelAndView mav = new ModelAndView(“admin/teamanage”);
return mav;
}
@RequestMapping(“/hrefmohunametea”)
public ModelAndView hrefmohunametea(String teaname,Model model,HttpSession session) {
List list=adminService.selectbynametea(teaname);
session.setAttribute(“tealist”,list);
ModelAndView mav = new ModelAndView(“admin/mohuname2”);
return mav;
}
@RequestMapping(“/hrefxiutea”)
public String hrefxiutea(String id,Model model) {
Teacher teacher=adminService.selectonetea(id);
model.addAttribute(“teacher”,teacher);
return “admin/updatetea”;
}
}
LoginController
最后
权威指南-第一本Docker书
引领完成Docker的安装、部署、管理和扩展,让其经历从测试到生产的整个开发生命周期,深入了解Docker适用于什么场景。并且这本Docker的学习权威指南介绍了其组件的基础知识,然后用Docker构建容器和服务来完成各种任务:利用Docker为新项目建立测试环境,演示如何使用持续集成的工作流集成Docker,如何构建应用程序服务和平台,如何使用Docker的API,如何扩展Docker。
总共包含了:简介、安装Docker、Docker入门、使用Docker镜像和仓库、在测试中使用Docker、使用Docker构建服务、使用Fig编配Docke、使用Docker API、获得帮助和对Docker进行改进等9个章节的知识。
关于阿里内部都在强烈推荐使用的“K8S+Docker学习指南”—《深入浅出Kubernetes:理论+实战》、《权威指南-第一本Docker书》,看完之后两个字形容,爱了爱了!
ea(String id,Model model) {
Teacher teacher=adminService.selectonetea(id);
model.addAttribute(“teacher”,teacher);
return “admin/updatetea”;
}
}
LoginController
最后
权威指南-第一本Docker书
引领完成Docker的安装、部署、管理和扩展,让其经历从测试到生产的整个开发生命周期,深入了解Docker适用于什么场景。并且这本Docker的学习权威指南介绍了其组件的基础知识,然后用Docker构建容器和服务来完成各种任务:利用Docker为新项目建立测试环境,演示如何使用持续集成的工作流集成Docker,如何构建应用程序服务和平台,如何使用Docker的API,如何扩展Docker。
总共包含了:简介、安装Docker、Docker入门、使用Docker镜像和仓库、在测试中使用Docker、使用Docker构建服务、使用Fig编配Docke、使用Docker API、获得帮助和对Docker进行改进等9个章节的知识。
[外链图片转存中…(img-WHoEqwl6-1715369582053)]
[外链图片转存中…(img-qSiDIMeZ-1715369582053)]
[外链图片转存中…(img-imJSl4yJ-1715369582054)]
[外链图片转存中…(img-rrkILiPW-1715369582054)]
关于阿里内部都在强烈推荐使用的“K8S+Docker学习指南”—《深入浅出Kubernetes:理论+实战》、《权威指南-第一本Docker书》,看完之后两个字形容,爱了爱了!