4 Commits 07002ff339 ... fe87179679

Autore SHA1 Messaggio Data
  liuchuanwei fe87179679 feat(ide):新增Obsidian使用总结 4 mesi fa
  liuchuanwei 86b68ea879 feat(java):新增Apache Common Lang3使用总结 4 mesi fa
  liuchuanwei 081c8f0ef8 feat(spring):新增spring mvc运行流程研究 4 mesi fa
  liuchuanwei fd3ae45f28 feat(maven):新增maven仓库优先级研究 4 mesi fa

+ 0 - 0
.imgs/1292892-20200726152210904-1519441181.png.md


+ 9 - 0
ide/obsidian使用总结.md

@@ -0,0 +1,9 @@
+## 定位当前文件在目录中的位置
+
+可以试一下 File Tree Alternative Plugin 插件  
+或者给 文件列表:在文件列表中显示当前文件  
+命令加个快捷键 Alt+F1
+
+## 在新标签页打开文件
+
+使用 Ctrl+o 搜索文件后,点击文件后,将替换当前标签页的文件;如果按住 Ctrl 再点击文件,将会在新标签页打开。

+ 2 - 0
java/Apache Common Lang3 使用.md

@@ -0,0 +1,2 @@
+参考:[关于Apache Commons-Lang3的使用)](https://www.cnblogs.com/Chary/articles/18027590)
+[Apache Commons Lang 3.10使用简介](https://www.cnblogs.com/niunafei/p/12812711.html)

+ 35 - 0
maven/Maven仓库优先级.md

@@ -0,0 +1,35 @@
+参考:
+[Maven仓库理解和优先级](https://swenfang.github.io/2018/06/03/Maven-Priority/)
+[一文弄懂maven仓库优先级, settings pom配置关系及差异](https://blog.csdn.net/taugast/article/details/113787531)
+
+maven中关于仓库repository的配置有6处、文件有3个:
+1、项目内的pom.xml
+* repository
+* profile
+2、~/.m2/setting.xml (即 user setting)
+* mirror
+* profile
+3、MAVEN_HOME/conf/setting.xml (即 global setting)
+* mirror
+* profile
+
+```
+优先级从高到低:
+1、本地仓库
+2、global settings active profile
+3、user settings active profile
+4、pom profile
+5、pom repository
+6、user mirror
+7、global mirror
+ 
+pom中的repository配置高于user/global settings中的mirror;
+user/global settings中的activa profile高于pom中的repository;
+global settgings中的active profile高于user settings中的active profile;
+user settings active profile高于mirror(checked)
+ 
+但是settings定位不同,它倾向于提供一些公共的附属信息,而不是个性化的构建信息.它会尽量融合到你的pom中.
+```
+
+结论如上,下面实验。
+

+ 0 - 16
mysql/MySQL使用指南.md

@@ -1,16 +0,0 @@
-MySQL数据库中的 UTF8 编码使用3个字节存储字段,无法存储emoji 表情这样的字段数据。
-
-MySQL5.5.3+ 后来加入了 utf8mb4 支持,完全兼容 utf8。utf8mb4 最多使用4个字节存储字符,这样就可以存储emoji表情了。
-
-Tip:
-
-* jdbc url 中不要加 characterEncoding=UTF-8 或者 characterEncoding=UTF8MB4。连接器会自动识别字符编码的。
-* utf8mb4 对MySQL 版本要求最低 5.5.3
-* utf8mb4 对 jdbc mysql驱动版本最低 5.1.41
-
-
-
-### 更新字段值为null
-
-update tblname set 字段=null where condition; 直接用常量Null。
-这个是有条件限制的。可以先select *from table_name查看一下表中想设置的那个列的属性是否设置了NOT NULL,如果设置了NOT NULL,那么是不能简单的修改为NULL的。必须先修改这个列的属性,alter table table_name set (列名) varchar(100) default null现在就是默认为空,如果查询出来是允许为空,直接update 表名 set 列名=null where 条件即可。

+ 57 - 0
spring/SpringMVC 业务流程.md

@@ -0,0 +1,57 @@
+
+Spring MVC 涉及众多的注解和配置,很难完全记住,最好的办法就是熟悉其中运行流程,将注解和相关配置串联起来,这样掌握的牢固。
+
+## <Context:annotation-config /> 和 <context:component-scan >
+
+参考:[Spring开启Annotation<context:annotation-config>和<context:component-scan>诠释及区别](https://www.cnblogs.com/leiOOlei/p/3713989.html)
+
+
+要想以下这些注解在Spring Bean中生效,就必须在Spring容器中注册相应的BeanPostProcessor 
+
+```java
+@Autowired
+org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
+
+@Resource、@PostConstruct、@PreDestory 
+org.springframework.beans.factory.annotation.CommonAnnotationBeanPostProcessor
+
+@PersistenceContext
+org.springframework.beans.factory.annotation.PersistenceAnnotationBeanPostProcessor
+
+@Required
+org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
+
+```
+每个注解,都有对应的解析器类。早期这些BeanPostProcessor一个一个的注册太麻烦,于是出现了 <context:annotation-config /> 简化配置
+
+<context:annotation-config /> 用于激活那些已经在spring容器里注册过的bean里面的注解,其本质就是向Spring注册以下 BeanPostProcessor
+```xml
+<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
+<bean class="org.springframework.beans.factory.annotation.CommonAnnotationBeanPostProcessor"/> 
+<bean class="org.springframework.beans.factory.annotation.PersistenceAnnotationBeanPostProcessor"/> 
+<bean class="org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor"/> 
+```
+
+
+**注:如果配置了<context:component-scan>那么<context:annotation-config/>标签就可以不用在xml中再配置了,因为前者包含了后者。另外<context:component-scan>还提供了两个子标签 <context:include-filter>和 <context:exclude-filter> **
+
+参考:[springMVC之配置context:component-scan详解](https://blog.csdn.net/huawen6/article/details/89329629)
+
+
+## HandlerMapping 和 HandlerAdapter
+
+参考:
+* [详解SpringMVC-RequestMappingHandlerMapping](https://blog.csdn.net/m0_71777195/article/details/129224900)
+* [SpringMVC中HandlerMapping和HandlerAdapter详解(适配器模式)](https://blog.csdn.net/zxd1435513775/article/details/103000992)
+* [SpringMVC工作原理之处理映射-HandlerMapping](https://www.jianshu.com/p/f04816ee2495)
+
+HandlerMapping是一个接口,只提供了一个方法 getHandler,根据Http请求获取Handler链。
+如果在 spring-servlet.xml 中配置了 <mvc:annotation-driven /> ,那么在 DispatchServlet 初始化时,即初始化Spring Web容器时,会自动注册 RequestMappingHandlerMapping、BeanNameHandlerMapping、SimpleUrlHandlerMapping 这三个处理器映射器。注册过程在 DispatcherServlet#initHandlerMappings 方法中。
+
+其中<mvc:annotation-driven />同时也会自动注册 HandlerAdapter,适配不同类型的Handler。在HandlerAdaptor中会自动装配一个消息转换器:MappingJackson2HttpMessageConverter,可以将响应到浏览器的Java对象转换为Json格式的字符串。
+
+## 注解ControllerAdvice
+
+参考:
+* [Spring的@ControllerAdvice注解作用原理探究](https://zhuanlan.zhihu.com/p/73087879)
+