com.baomidou
mybatis-plus-boot-starter
3.2.0
javax.servlet
javax.servlet-api
javax.servlet
jstl
org.apache.tomcat.embed
tomcat-embed-jasper
org.springframework.boot
spring-boot-maven-plugin
===========================================================================
server:
port: 8090 #定义端口
servlet:
context-path: / #定义项目的发布路径
spring:
datasource:
#driver-class-name: com.mysql.cj.jdbc.Driver springboot程序采用默认的配置
url: jdbc:mysql://127.0.0.1:3306/jtdb?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
username: root
password: root
mvc: #引入mvn配置
view:
prefix: /WEB-INF/ # /默认代表根目录 src/main/webapp
suffix: .jsp
mybatis-plus:
#定义别名包
type-aliases-package: com.jt.pojo
#加载user标签的mapper文件
mapper-locations: classpath:/mybatis/mappers/*.xml
#开启驼峰映射
configuration:
map-underscore-to-camel-case: true
#引入日志信息.
logging:
level:
com.jt.mapper: debug
==============================================================================
【要求】
用户通过 http://localhost :8090/findAll请求。跳转到userList.jsp页面中,并且展现user表中的所有数据,以MP方式查询
====================================================================================
package com.jt.controller;
import com.jt.pojo.User;
import com.jt.service.UserService;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
//@RestController //json 字符串本身 不经过视图解析器
@Controller
public class UserController {
@Autowired
private UserService userService;
/**
-
需求:用户通过http://localhost:8090/findAll
-
跳转页面路径:userList.jsp
-
页面取值信息: el表达式:${userList} 从域中取值.
-
在页面跳转之前应该将userList数据保存到域中 key就是userList.
*/
@RequestMapping(“/findAll”)
public String findAll(Model model){ //利用model对象将数据保存到request对象中.
//1.查询数据库 获取list集合信息
List userList = userService.findAll();
model.addAttribute(“userList”,userList);
System.out.println(userList);
return “userList”;
}
}
=================================================================================
package com.jt.service;
import com.jt.mapper.UserMapper;
import com.jt.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class UserServiceImpl implements UserService{
@Autowired
private UserMapper userMapper;
@Override
public List findAll() {
return userMapper.selectList(null);
}
}
===================================================================================
说明:配置IDEA启动项,将工作目录配置到本项目即可!
===============================================================================
=============================================================================
需求:用户通过: http://localhost :8090/ajax.jsp页面中
/**
- 跳转到ajax.jsp页面
*/
@RequestMapping(“/ajax”)
public String ajax(){
return “ajax”;
}
页面效果呈现
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数前端工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:前端)
结尾
正式学习前端大概 3 年多了,很早就想整理这个书单了,因为常常会有朋友问,前端该如何学习,学习前端该看哪些书,我就讲讲我学习的道路中看的一些书,虽然整理的书不多,但是每一本都是那种看一本就秒不绝口的感觉。
以下大部分是我看过的,或者说身边的人推荐的书籍,每一本我都有些相关的推荐语,如果你有看到更好的书欢迎推荐呀。
58523577)]
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:前端)
[外链图片转存中…(img-q1EZhmCP-1713558523577)]
结尾
正式学习前端大概 3 年多了,很早就想整理这个书单了,因为常常会有朋友问,前端该如何学习,学习前端该看哪些书,我就讲讲我学习的道路中看的一些书,虽然整理的书不多,但是每一本都是那种看一本就秒不绝口的感觉。
以下大部分是我看过的,或者说身边的人推荐的书籍,每一本我都有些相关的推荐语,如果你有看到更好的书欢迎推荐呀。