![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
文章平均质量分 67
我的风格0.0
这个作者很懒,什么都没留下…
展开
-
常用注解,依赖,常用类,插件和其它(自用)
参考重点参考:java开发注解大全 这里面除了spring的常用注解以外,还有其它包的注解 比较全SpringBoot参考:SpringBoot注解大全下面是自己总结的自己笔记java注解大全参考:https://www.cnblogs.com/ranandrun/p/annotation.html实用的注解:@Controller 和 @RestController使用@Controller 注解,在对应的方法上,视图解析器可以解析return 的jsp,html..原创 2021-07-06 11:20:17 · 1573 阅读 · 0 评论 -
上传文件太大 net::ERR_CONNECTION_ABORTED 500 (Internal Server Error) 连接失败错误
前端技术: VUE, element UI后端技术: springCloud springBoot前台上传文件时一直报错:net::ERR_CONNECTION_ABORTED问题根因: 上传文件太大, 超过后台配置解决办法: 后台application.yml中添加配置:spring: servlet: multipart: enabled: true max-file-size: 100MB max-request-size: 100...转载 2021-06-10 10:45:03 · 1032 阅读 · 0 评论 -
SpringBoot整合Mybatis
SpringBoot整合Mybatis添加Mybatis的起步依赖<!--mybatis起步依赖--><dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.0</version></dep原创 2020-12-22 15:23:22 · 121 阅读 · 0 评论 -
spring+templates的无法访问css,js等静态资源的问题
我的目录结构:我的问题:templates下的index.html不能访问static下的子目录css,images,js中的静态资源先看https://blog.csdn.net/yu514950381/article/details/78015088总结:classpath:/staticclasspath:/publicclasspath:/resourcesclasspath:/META-INF/resources这4个是官方默认的扫描路径,可以将静态文件放入其中,但列如,用原创 2021-01-24 20:05:33 · 2438 阅读 · 0 评论 -
springboot thymeleaf 评论回复功能前端代码
我的笔记而已,小白勿看。当然你可以参考下面的链接:评论回复数据库设计,代码设计,前端部分设计:链接: https://www.cnblogs.com/lizhaoyao/p/8617436.html.链接: https://blog.csdn.net/qq_38157825/article/details/104890308.链接: https://blog.csdn.net/weixin_44566320/article/details/87836233.三目运算符解决链接链接: https:原创 2021-04-10 23:00:18 · 1426 阅读 · 0 评论 -
spring前后端传参交互 和细节
前端有传递Json对象或Json字符串两种方式后端有用 @RequestParam 和 @RequestBody和@PathVariable(这个不常用)注解接受值图里的后端获取方式不全,下面有补充情况一一般使用GET请求,url路径参数前端传递Json对象后端使用@RequestParam 或不使用直接接受前端的contentType默认格式是 application/x-www-form-urlencoded优点:一、前端传递数据不用转换为Json字符串:Json.s原创 2021-04-23 16:22:14 · 4056 阅读 · 4 评论 -
Mybatis分页插件PageHelper使用教程
添加依赖 <!--添加分页插件--><!--只配置当前这一个依赖 PageHelper不生效--> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.1.10<原创 2021-04-25 17:29:20 · 882 阅读 · 0 评论 -
Controller层使用@value注解获取不到 yml文件中的properties属性值
原因:@Value并不会主动去父容器中查找配置文件属性值,你要配置或注入用注入方式就获取到了@Servicepublic class PropertyService { @Value("${isc.app-id}") private String iscAppid;}在controller注入:@Autowiredprivate PropertyService propertyService;isc: app-id: 12121313456参考:https://w原创 2021-05-18 14:28:15 · 2564 阅读 · 0 评论 -
使用@Pattern@Validated校验 并抛出异常
基类里的属性regexp 是正则表达式一般默认就填入正则表达式即可,但是java中字符串需要转义,这个需要注意一下。基类 /** 标识码 */ @Pattern(regexp = "^\\d{11}$",message = "mis只能由数字组成") @ApiModelProperty("标识码") private String mis;控制层在传参或者controller层中的添加@Validated注解进行调用,我这里是在控制层添加控制层加上@Validat原创 2021-05-22 17:27:37 · 3228 阅读 · 0 评论