zxy16305 / blog Goto Github PK
View Code? Open in Web Editor NEWbak for hexo
bak for hexo
存在两种规范,CommonJS和AMD。
对于AMD,采用异步方式加载模块,模块的加载不影响后面语句的运行。
eg. require([module],callback)
学自各位大佬 👍
在置入基础的环境(applicationContext)后 , 注入xml的位置,并解析其中的占位表达式。
refresh() : 加载或者刷新配置的持久层表示
(以下内容基本为源码的注解翻译 😂 见笑见笑)
准备context
获取bean factory(DefaultListableBeanFactory)
准备这个context要使用的bean factory
bean的存储方式(以DefaultListableBeanFactory为例), 存在这四个容器中:
- Map<String,Object> singletonObjects ;
- Map<String,ObjectFactory<?>> singletonFactories ;
- Map<String,Object> earlySingletonObjects ;
- Set registeredSingletons ;
允许bean factory的后期处理(然而这一步什么也没做)
在上下文中调用注册为bean的factory processors(2018/1/22)
在这一步或者这一步之前已经完成了对bean注解的搜索(在beanFactory也就是后面的registry里,看到了所有的bean)
意思是在监听bean的行为,触发一些方法
好像是国际化?
就结果来看,只加了一个messageSource的bean
就结果来看,只加了一个叫applicationEvenMulticaster的bean,默认为SimpleApplicationEventMulticaster。
对于AbstractRefreshableWebApplicationContext而言,只是初始化了themeSource
初始化..就是把这个bean的name加入了一个set中
也就是之前看到的controller的实例化 :在AbstractBeanFactory.doGetBean()里面
以上所述方法都是接口中的方法 😂
1.mysql在windows环境下的大小写配置
找到my.ini ,加入
lower_case_table_names = 0
(如果此时启动mysql服务报错了,那么就改成2,这是由于mysql的版本造成的)
即为大小写敏感,1为不敏感
https://docs.spring.io/spring-boot/docs/1.5.9.RELEASE/reference/htmlsingle/#boot-features-cors
按照这样配一下就好了 :滑稽:
前台本来是按照教程使用xmlHttpResquest,有点麻烦。
后来经过测试,jquery的ajax就可以使用(使用的版本是jquery-3.3.1)。
进一步验证(刚才是在本地的另一个端口的服务器前段进行的验证),在随便一个网页上(非https),插入jquery的js(document.write("<script language='javascript' src='https://code.jquery.com/jquery-3.3.1.min.js'></script>");),再同样运行jquery的ajax请求本地服务器,得到了同样的结果
spring同一般的tomcat的servlet程序,只在web.xml处多配了 ContextLoaderListener和RequestDispatcherServlet两个类,就完成了servlet的拓展。看过了ComtextLoaderListener后(一知半解),再来看看ResquestDispatcherServlet。
在web.xml把他配成了一个servlet,并映射到 “/”路径上(一般情况下),这样任何请求都会到这个servlet里面。
观察其重写方法( init() , service(req,resp) , destroy() )的位置,
这个流程把主要的方法(有注释的方法 😂)列出来了,第二步看上去很奇怪是因为,HttpServlet里没有定义Patch的method。
基于 1.11.10.RELEASE (spring boot 1.5.10.RELEASE 所用的版本)
由于上次看文档没有看到复杂查询, 这次再仔细看一遍
先搬几个链接
https://my.oschina.net/songxinqiang/blog/313226?p=1&temp=1517196380855#blog-comments-list
https://www.xncoding.com/2018/01/27/tool/maven-central.html
发布这东西果然异常麻烦
先是照着第二位老哥的教程走了一遍没走通。后来以为*.pom的配置出了问题,便继承了第一位老哥的提供的pom。顺便登录查看下自己的仓库,才发现密码被改了??? 可能是太简单的缘故:joy: 在改回密码后Bianc便顺利提交了...
发布的命令是
mvn clean deploy -P oss
其中oos表示*.pom中的 serverId
简单地东西就跳过了,在官方的demo上都找得到
1.poi-excel插入图片的坑
excel官方提供了两种,HSSFWorkbook和XSSFWorkbook
这里这个只试出了HSSFWorkbook的简单操作(注解和demo少得可怜。。)
Workbook wb = new HSSFWorkbook();
Sheet sheet = wb.createSheet("new");
//画笔,一个sheet创建一个就行了
Drawing<?> drawingPatriarch = sheet.createDrawingPatriarch();
int pictureIndex1 = wb.addPicture(data1, Workbook.PICTURE_TYPE_JPEG);
//这个初始化参数决定插入的图片的参数
ClientAnchor xssfClientAnchor1 = new HSSFClientAnchor(0,0,1023,127,(short)0,0,(short)0,0);
drawingPatriarch.createPicture(xssfClientAnchor1,pictureIndex1);
//保存
wb.write(outputStream);
这里讲一下这个构造函数 new HSSFClientAnchor(int dx1, int dy1, int dx2, int dy2, short col1, int row1, short col2, int row2)
* @param dx1 the x coordinate within the first cell.
* @param dy1 the y coordinate within the first cell.
* @param dx2 the x coordinate within the second cell.
* @param dy2 the y coordinate within the second cell.
* @param col1 the column (0 based) of the first cell.
* @param row1 the row (0 based) of the first cell.
* @param col2 the column (0 based) of the second cell.
* @param row2 the row (0 based) of the second cell.
其中dx的取值是0-1023,dy的取值是0-255.
他会把下一格分成这么多份,然后去规范图片的大小
(但同时会失去拉伸性能)
丢人ing~ 😂
先看的是目录(怎么有这么长的目录)
LDAP DSL CAS JAAS CSRF
HttpSecurity 里面一堆配置方法(注释非常齐全)【重头配置】
5.8.2 GlobalMethodSecurityConfiguration--2018-2-2--
9.4.1 ExceptionTranslationFilter--2018-2-6--
再开个坑(见鬼了)
springboot的源码,从SpringApplication的注释开始读起
多以以下的的内容多数可在源码的注释里找到
相比较其他spring的注释,boot的注释真的是简单明了啊 😂
收回之前的话 方法里依然得读死:joy:
特性详见 官方教程 && 本文概要其特性 -> 相当于目录
Linux的学习记录 😂
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.