SpringBoot水果商城后台管理系统(文末附源码),程序员去大公司面试

1.1.12

javax.servlet

jstl

1.2

org.springframework.boot

spring-boot-starter-test

org.springframework.boot

spring-boot-starter-aop

org.apache.tomcat.embed

tomcat-embed-jasper

(2)配置application.yml

server:

port: 8080 #端口号

servlet:

context-path: /fruitmall #水果商城

jsp:

init-parameters:

development: true #开启jsp页面的调试模式

spring:

mvc:

view:

prefix: / #前缀

suffix: .jsp #后缀

数据源

datasource:

type: com.alibaba.druid.pool.DruidDataSource #数据源类型

driver-class-name: com.mysql.cj.jdbc.Driver #加载驱动

url: jdbc:mysql://localhost:3306/fruitmall?useSSL=false&serverTimezone=UTC

username: root

password: root

mybatis:

mapper-locations: classpath:com/tjcu/mapper/*Mapper.xml #指定mapper文件所在的位置,其中classpath必须和mapper-locations分开

type-aliases-package: com.tjcu.entity

四、管理员核心功能

============================================================================

1、前端

<%@page isELIgnored=“false” contentType=“text/html; harset=utf-8” pageEncoding=“UTF-8” %>

<%@taglib prefix=“c” uri=“http://java.sun.com/jsp/jstl/core” %>

login

欢迎进入水果管理系统V1.0


验证码:

换一张

${requestScope.msg}

Fruit@136.com

2、控制层

package com.tjcu.controller;

import com.tjcu.entity.Admin;

import com.tjcu.service.AdminService;

import com.tjcu.utils.VerifyCodeUtils;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletOutputStream;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import java.io.IOException;

import static javax.swing.text.html.CSS.getAttribute;

/**

  • @author 王恒杰

  • @date 2021/11/28 16:22

  • @Description:

*/

@Controller

@RequestMapping(“admin”)

public class AdminAction {

@Autowired

private AdminService adminService;

@RequestMapping(“login”)

public String login(Admin admin, HttpServletRequest request,String adminCode){

//1.比较验证是否一致

HttpSession session = request.getSession();

String code = session.getAttribute(“code”).toString();

if(code.equals(adminCode)){

Admin login = adminService.login(admin.getUsername(), admin.getPassword());

if(login!=null){

request.setAttribute(“admin”,login);

session.setAttribute(“admin”,login);

return “forward:/fruit/showAll?pageNumber=1”;

}else {

request.setAttribute(“msg”,“用户名或者密码输入错误”);

return “login”;

}

}else {

request.setAttribute(“msg”,“验证码输入错误”);

return “login”;

}

}

/**

  • 用来生成验证码方法

*/

@RequestMapping(“generateImageCode”)

public void generateImageCode(HttpSession session, HttpServletResponse response) throws IOException {

//1.生成随机字符串

String code = VerifyCodeUtils.generateVerifyCode(4);

//2.保存随机字符串到Session中

session.setAttribute(“code”,code);

//3.将随机字符串生成图片

//4.通过response响应图片

response.setContentType(“image/png”);//指定响应类型

ServletOutputStream os = response.getOutputStream();

VerifyCodeUtils.outputImage(80,30,os,code);

}

@RequestMapping(“cancel”)

public String cancel(HttpServletRequest request){

request.getSession().invalidate();

request.setAttribute(“msg”,“管理员已经退出登录!”);

return “login”;

}

}

五、水果相关功能核心代码

===============================================================================

1、全选jquery实现

3、修改和数据回显前端页面

<%@page isELIgnored=“false” contentType=“text/html; harset=utf-8” pageEncoding=“UTF-8” %>

<%@taglib prefix=“c” uri=“http://java.sun.com/jsp/jstl/core” %>

\

<%@taglib prefix=“fmt” uri=“http://java.sun.com/jsp/jstl/fmt” %>

update

欢迎进入水果管理系统V1.0

修改水果信息:

<input type=“text” class=“form-control” name=“name” id=“name” value=“${requestScope.fruit.name}”

placeholder=“输入水果名称”>

<input type=“text” class=“form-control” name=“price” id=“price”

value=“${requestScope.fruit.price}” placeholder=“输入水果价格”>

<input type=“text” class=“form-control” id=“age” name=“month”

value=“${requestScope.fruit.month}” placeholder=“输入水果保质期”>

小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数初中级Java工程师,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Java开发全套学习资料》送给大家,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
img
img
img

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频

如果你觉得这些内容对你有帮助,可以添加下面V无偿领取!(备注Java)
img

最后

一次偶然,从朋友那里得到一份“java高分面试指南”,里面涵盖了25个分类的面试题以及详细的解析:JavaOOP、Java集合/泛型、Java中的IO与NIO、Java反射、Java序列化、Java注解、多线程&并发、JVM、Mysql、Redis、Memcached、MongoDB、Spring、Spring Boot、Spring Cloud、RabbitMQ、Dubbo 、MyBatis 、ZooKeeper 、数据结构、算法、Elasticsearch 、Kafka 、微服务、Linux。

这不,马上就要到招聘季了,很多朋友又开始准备“金三银四”的春招啦,那我想这份“java高分面试指南”应该起到不小的作用,所以今天想给大家分享一下。

image

请注意:关于这份“java高分面试指南”,每一个方向专题(25个)的题目这里几乎都会列举,在不看答案的情况下,大家可以自行测试一下水平 且由于篇幅原因,这边无法展示所有完整的答案解析

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频

如果你觉得这些内容对你有帮助,可以添加下面V无偿领取!(备注Java)
[外链图片转存中…(img-00LHut63-1711084062157)]

最后

一次偶然,从朋友那里得到一份“java高分面试指南”,里面涵盖了25个分类的面试题以及详细的解析:JavaOOP、Java集合/泛型、Java中的IO与NIO、Java反射、Java序列化、Java注解、多线程&并发、JVM、Mysql、Redis、Memcached、MongoDB、Spring、Spring Boot、Spring Cloud、RabbitMQ、Dubbo 、MyBatis 、ZooKeeper 、数据结构、算法、Elasticsearch 、Kafka 、微服务、Linux。

这不,马上就要到招聘季了,很多朋友又开始准备“金三银四”的春招啦,那我想这份“java高分面试指南”应该起到不小的作用,所以今天想给大家分享一下。

[外链图片转存中…(img-vdk3enJc-1711084062157)]

请注意:关于这份“java高分面试指南”,每一个方向专题(25个)的题目这里几乎都会列举,在不看答案的情况下,大家可以自行测试一下水平 且由于篇幅原因,这边无法展示所有完整的答案解析

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

  • 8
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值