- 博客(262)
- 问答 (1)
- 收藏
- 关注
原创 mysql数据库自增id和uuid选择
自增ID优点插入有序.在innodb引擎下,查询和插入速度快,占用空间小缺点多表合并和数据迁移会有id冲突 (如A表 和B表合并都有id=1的数据)UUID优点生成唯一id不会冲突缺点占用空间大,插入和查询速度慢总结大部分情况下,使用自增id即可,除非有分布式需求(此时也可以考虑雪花算法)...
2020-06-11 14:52:00
968
原创 SQL两列字段合并为一个字符串
select concat(concat(first_name,' '),last_name) as name FROM b_sys_user其中first_namelast_name为要合并字段
2020-05-11 15:52:10
2861
转载 thymeleaf th:href 动态url
使用 <a th:href="@{/product/show(skuid=${product.id})}" target="_blank">产品</a>可以得到 <a th:href="/product/show?skuid=12" target="_blank">产品</a>若有多个参数 在()里用 , 分开即可 如(skuid=${prod...
2020-03-19 11:54:40
1956
原创 bootstrap-select 设置下拉框显示个数,超出则显示滚动条
<select class="form-control selectpicker" data-size="5">默认显示5个
2020-03-10 15:28:10
7426
3
转载 分治法
分治法将一个大问题分成多个子问题的,把这些小的易求解的子问题解决出来,大问题也就解决了什么时候使用问题缩小到一定规模容易解决分解的子问题是相同种类的子问题,即该问题具有最优子结构分解后的子问题可以合并子问题的作用区间不重复其中第第一条基本都能满足,第二条反应的的递归的思想也容易满足,第三条是能否使用分治的关键如果不满足第三条可以是考虑贪心或者dp,第四条不满足也可以进行分...
2019-05-22 01:35:57
268
原创 654. Maximum Binary Tree
分类:medium 树 分治题目介绍Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:The root is the maximum number in the array. The left subtree is the ...
2019-04-09 00:20:29
338
原创 对象输出String 的三种方式
1.(String)xx2. xxx.toString()3.String.valueOf(xxx)先说结论推荐使用第三种 String.valueOf(xxx)因为 第一种 (String)xx 会出现ClassCastException 类型转化异常第二种 xx.toString() 会出现nullPointException 空指针异常第三种 无论如何 都会有值...
2019-03-27 16:10:48
998
原创 Data truncation Data too long for column
执行数据库语句时候 String类型异常表现:String的值为[Ljava.lang.String;@57edac58原因:此异常原因为 将String[] 类型转为String解决方法//arr为String[] arr={"1","2","3"}String str=Arrays.toString(arr);//此时str为"[1,2,3]"...
2019-03-23 22:54:28
883
原创 Java中net.sf.json包关于JSON与对象转换的问题
建议直接使用Gson包net.sf.json包已经很久不维护了maven依赖 <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.2.4</v...
2019-03-08 01:28:47
726
转载 illegal escape character in String literal
写文件路径的时候可以使用/作为分隔符或者File.separator,最好不用\,因为这个斜杠用的时候需要在前面再加一个\转义,并且这个分隔符只对windows系统有用,局限性比较严重...
2018-12-27 21:54:03
9999
2
原创 Springboot启动的时候会出现数据源错误 ailed to configure a DataSource
Springboot启动的时候会出现数据源错误Description:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver ...
2018-12-27 10:16:16
1653
转载 Http请求报文解析
学习Web开发不好好学习HTTP报文,将会“打拳不练功,到老一场空”,你花在犯迷糊上的时间比你沉下心来学习HTTP的时间肯定会多很多。Http请求报文解析请求行 下图123(第一行)请求头请求体请求行1是请求方法,get和post是最常见的HTTP方法。2为请求对应的url + 3为http协议版本请求头4是是http的报文头,报文头包含若干个属性,格式为“属性名:属...
2018-12-20 11:14:42
1710
原创 Markdown的特殊符号
有的时候markdown打入特殊字符会报错,此时需要打入该字符的替代码 如想打 < 则打&lt这样既可(有的时候需要去除分号)符号对照如下 ...
2018-12-19 09:42:12
2561
原创 @Autowired is not applicable to local variable
@AutowiredXXX xxx不能写在方法体内
2018-12-14 10:06:22
1943
原创 常用css属性整理
position: 属性规定元素的定位类型 http://www.w3school.com.cn/cssref/pr_class_position.aspbox-sizing: 属性允许您以特定的方式定义匹配某个区域的特定元素。例如,假如您需要并排放置两个带边框的框,可通过将 box-sizing 设置为 "border-box"。这可令浏览器呈现出带有指定宽度和高度的框,并把边框和内边距...
2018-12-08 22:48:56
369
转载 @RequestBody @RequestBody 等参数说明
根据处理Request 的不同 分为4种1、处理request body部分的注解 :@RequestParam, @RequestBody2、处理request header部分的注解: @RequestHeader, @CookieValue3、处理requet uri 部分(这里指uri template中variable,不含queryString部分)的注解: @Pa...
2018-12-02 22:40:21
5193
原创 Vue 语法v-show和 v-if
使用了v-if的时候,如果值为false,那么页面将不会有这个html标签生成。v-show则是不管值为true还是false,html元素都会存在,只是CSS中的displv-if 是“真正”的条件渲染,因为它会确保在切换过程中条件块内的事件监听器和子组件适当地被销毁和重建。v-if 也是惰性的:如果在初始渲染时条件为假,则什么也不做——直到条件第一次变为真时,才会开始渲染条件块。相...
2018-11-13 14:08:56
338
原创 Truthy
在JavaScript中,Truthy(真值)指的是在Boolean上下文中转换后的值为真的值。所有值都是真值,除非它们被定义为 falsy (即, 除了false,0,“”,null,undefined和NaN 外)。JavaScript 在Boolean上下文中使用强制类型转换(coercion)。JavaScript中的真值示例如下(将被转换为true类型,if 后的代码段将被执行)...
2018-11-13 10:38:05
468
原创 java.lang.SecurityException: Prohibited package name:
此错误为: JVM 不允许包名以java开头
2018-09-28 10:36:01
1030
原创 check the manual that corresponds to your MySQL server version for the right syntax
出现该错误是,表中出现了 Mysql 保留的关键字附上Mysql 关键字表
2018-09-27 10:19:55
29558
原创 hashMap 中 key和value交换
import java.util.HashMap;import java.util.Hashtable;import java.util.Set;import java.util.Collection;class TestCollection{ public static void main(String[] args) { HashMap<String,...
2018-08-30 09:47:52
6221
转载 HTTP 状态
转自:https://blog.youkuaiyun.com/tennysonsky/article/details/44562435HTTP 是一个属于应用层的面向对象的协议,HTTP 协议一共有五大特点:1、支持客户/服务器模式;2、简单快速;3、灵活;4、无连接;5、无状态。 无连接无连接的含义是限制每次连接只处理一个请求。服务器处理完客户的请求,并收到客户的应答后,即断开连接。采用这种...
2018-08-16 08:53:09
369
原创 AOP 通知
顾问(Advisor)是 Spring 提供的另一种切面。其可以完成更为复杂的切面织入功能。PointcutAdvisor 是顾问的一种,可以指定具体的切入点。顾问将通知进行了包装,会根据不同的通知类型,在不同的时间点,将切面织入到不同的切入点。 PointcutAdvisor 接口有两个较为常用的实现类: NameMatchMethodPointcutAdvisor 名称匹配方法切入点顾问
2018-01-19 10:54:06
490
原创 AOP 有接口使用cglib
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-18 11:48:55
487
原创 AOP 无接口使用cglib
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-18 11:00:52
468
原创 AOP 为目标方法织入多个通知
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-18 10:40:12
514
原创 AOP 捕获自定义异常
package com.gqc.aop05;import org.springframework.aop.ThrowsAdvice;//异常通知public class MyThrowsAdvice implements ThrowsAdvice { // 当目标方法抛出UsernameException异常时,执行当前方法 public void afterThrowing(Use
2018-01-17 16:21:35
1932
原创 AOP 异常通知
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-17 10:49:54
565
原创 AOP 环绕通知
package com.gqc.aop03;import org.aopalliance.intercept.MethodInterceptor;import org.aopalliance.intercept.MethodInvocation;//环绕通知可以修改目标方法的返回结果public class MyMethodInterceptor implements MethodIn
2018-01-16 13:08:29
910
原创 AOP后置通知
package com.gqc.aop02;<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.
2018-01-16 11:25:34
665
原创 AOP前置通知
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-12 20:20:18
409
原创 AOP面向切面编程
aop 是面向对象编程oop的补充 面向对象编程是从静态的角度考虑程序的结构 面向切面编程是从动态的角度考虑程序运行的过程aop底层 是采用动态代理模式实现的 采用了两种代理 jdk的动态代理和 cglib的动态代理1、切面(aspect):对主业务进行增强的代码就是切面 常用的有通知advice和顾问advistor2、织入(weaving):将切面代码插入到目标对象的过程
2018-01-12 20:18:11
334
原创 为应用指定多个配置文件
包含关系<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-08 15:11:20
389
转载 classpath、path、JAVA_HOME的作用及JAVA环境变量配置
CLASSPATH是什么?它的作用是什么?它是javac编译器的一个环境变量。它的作用与import、package关键字有关。当你写下improt java.util.*时,编译器面对import关键字时,就知道你要引入java.util这个package中的类;但是编译器如何知道你把这个package放在哪里了呢?所以你首先得告诉编译器这个package的所在位置;如何告诉它呢?就是设
2018-01-08 14:59:44
393
原创 同类抽象Bean 异类抽象Bean
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-07 17:48:33
451
原创 内部Bean
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-07 16:10:41
430
原创 基于xml的di spel注入
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-07 15:44:53
350
原创 基于xml的注入di byName和byType
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans
2018-01-07 14:51:18
380
空空如也
IDEA 文件夹图标的问题
2018-05-10
TA创建的收藏夹 TA关注的收藏夹
TA关注的人