共 6 篇文章 |
|
java注解日志记录到数据库1. pom添加依赖包。METHOD) //注解放置的目标位置,METHOD是可注解在方法级别上@Retention(RetentionPolicy.RUNTIME) //注解在哪个阶段执行@Documented //生成文档public @interface MyLog { String value() default "";}@Controller@RequestMapping("/test")public class UserController { @MyLog... 阅108 转0 评0 公众公开 20-07-01 15:59 |
Eureka工作原理Eureka 工作原理。服务注册服务提供者启动时,会通过 Eureka Client 向 Eureka Server 注册信息,Eureka Server 会存储该服务的信息,Eureka Server 内部有二层缓存机制来维护整个注册表。Zone 内的 Eureka Client 优先和 Zone 内的 Eureka Server 进行心跳同步,同样调用端优先在 Zone 内的 Eureka Server 获取服务列表,当 Zon... 阅559 转0 评0 公众公开 20-04-25 10:38 |
@Data注解 与 lombok.public class Person { private String name;javac对源代码进行分析,生成了一棵抽象语法树(AST)运行过程中调用实现了“JSR 269 API”的Lombok程序此时Lombok就对第一步骤得到的AST进行处理,找到@Data注解所在类对应的语法树(AST),然后修改该语法树(AST),增加getter和setter方法定义的相应树节点javac使用修改后... 阅56 转0 评0 公众公开 20-04-08 09:54 |
<html xmlns:th="http://www.thymeleaf.org"><body> <h1>Product list</h1> <table> <tr> <th>NAME</th> <th>PRICE</th> <th>IN STOCK</th> </tr> <tr th:each="prod : ${prods}"> <td th:text="${prod.name}">Onio... 阅285 转0 评0 公众公开 19-05-16 15:16 |
1、springBoot中application.properties的常用配置。#spring.thymeleaf.cache=false#spring.thymeleaf.prefix=classpath:/templates/#spring.thymeleaf.check-template-location=true#spring.thymeleaf.suffix=.html#spring.thymeleaf.encoding=UTF-8#spring.thymeleaf.content-type=text/html#spring.thymeleaf.mode=HTML53、定义banner输出信... 阅1743 转10 评0 公众公开 19-05-10 16:41 |
@Component:泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注。个人理解相当于<context:component-scan>,如果扫描到有@Component @Controller @Service等这些注解的类,则把这些类注册为bean。@Configuration:指出该类是 Bean 配置的信息源,相当于XML中的<beans></beans>,一般加在主类上。@Bean:相当于XM... 阅57 转0 评0 公众公开 18-07-04 15:48 |