当前位置:网站首页>2022.7.1
2022.7.1
2022-07-17 00:02:00 【zmy668】
1.
@RequestMapping({"/","/index"})
// @ResponseBody
public String toIndex(Model model){
return "test";
}@RequestMapping后边括号里的/和/index是浏览器地址栏里的,用来指向使用controller里的哪个方法。
前后端不分离的项目:return "test"return "test"是所要显示的页面, 如果加了@ResponseBody则返回一个json对象,
前后端分离的页面:return "test"的test,返回一个json对象,如果想要重定向显示一个页面使用(return"redirect:/hello/world";?????)
2.pom文件(依赖)
前端:操作页面thymeleaf:thymeleaf-spring5,thymeleaf-extras-java8time,web页面:spring-boot-starter-web,
后台:连接数据库:mysql-connector-java,更换数据源:druid,整合mybatis:mybatis-spring-boot-starter,有参无参构造函数和getset方法:lombok,安全框架shiro整合spring和thymeleaf:shiro-spring,thymeleaf-extras-shiro,输出一些日志:log4j。
测试类:spring-boot-starter-test
3.“@RestController相当于@Controller和@ResponseBody合在一起的作用”
4.要注意springboot和swagger2版本问题。
springboot 2.6.9和swagger2 2.9.2 匹配,,访问localhost:8080/swagger-ui.html
在application.xml加这个或许可以解决冲突问题spring.mvc.pathmatch.matching-strategy= ANT_PATH_MATCHER
边栏推荐
- 微信小程序session持有
- 从22顶会看对比学习在推荐的应用
- 【著色器實現Wave效果_Shader效果第一篇】
- FactoryBean 使用场景
- 在mysql數據庫插入中文值出現的亂碼解决
- Fire prevention in midsummer! Guangdong carries out fire safety inspection in summer
- 【MD5】快速实现MD5加密解密(盐值)
- MySQL data table query
- 异步编程&协程
- Advanced Mathematics - Chapter 8 differential calculus of multivariate functions - extreme and maximum values of multivariate functions
猜你喜欢

Greenplum 6.x client connection

The logical architecture of MySQL

在mysql数据库插入中文值出现的乱码解决

【深度学习】(二)深度学习基础学习笔记

Switch and router technology: Integrated Experiment of hot backup routing protocols HSRP, HSRP and spvstp

The most beautiful yellow flower

Which is the best bag grabbing tool (violent theft foreplay)

玩转CSDN编辑器

Mysql—多版本並發控制(MVCC)

Deep and detailed understanding of matrix (addition, subtraction, multiplication, transpose, conjugate, conjugate transpose of matrix)
随机推荐
【日常训练】剑指 Offer II 041. 滑动窗口的平均值
Joint search set
(manual) [sqli-labs62-65] limit injection times: blind injection
面试官:怎么不用定时任务实现关闭订单?
【MD5】快速实现MD5加密解密(盐值)
Fire prevention in midsummer! Guangdong carries out fire safety inspection in summer
See the application of comparative learning in recommendation from 22 top meetings
Why processing data indicators
Service层需要接口吗
1764. 通过连接另一个数组的子数组得到一个数组 ●●
乐观锁和悲观锁在kubernetes中的应用
[JDBC] batch processing idea
Deep learning - multidimensional data and tensor
The most beautiful yellow flower
log4j2.xml配置详解
在mysql數據庫插入中文值出現的亂碼解决
mysql中的配置文件
mysql插入数据会失败?为什么?
CURL命令常用用法
J9数字论:去中心化身份的主流化还有多久?