几种JSON框架用法和效率对比:

https://blog.csdn.net/sisyphus_z/article/details/53333925

https://blog.csdn.net/weixin_42476601/article/details/81700981

https://blog.csdn.net/xuSir_1/article/details/72461364

https://www.cnblogs.com/cdf-opensource-007/p/6395458.html

https://blog.csdn.net/fanpeng1100/article/details/52856813

https://www.cnblogs.com/songjinduo/p/5279461.html

https://www.cnblogs.com/fly-piglet/p/5406506.html

json-lib:

http://www.cnblogs.com/sharpest/p/7844533.html

https://www.cnblogs.com/teach/p/5791029.html

Jackson:

https://blog.csdn.net/weixin_38111957/article/details/81585392

Gson:

https://www.cnblogs.com/majay/p/6336918.html

https://blog.csdn.net/axuanqq/article/details/51441590

fastJson:

https://blog.csdn.net/fullbug/article/details/78629033

Spring整合JUnit4:

https://blog.csdn.net/qq_32786873/article/details/56480880

Spring注解加载配置文件:

http://www.cnblogs.com/warehouse/p/8681187.html

https://www.cnblogs.com/lyjing/p/8406827.html

https://blog.csdn.net/haha_sir/article/details/79105951

https://blog.csdn.net/qq_15204179/article/details/82178802

Spring代码获取配置文件属性值:

https://www.cnblogs.com/yzuzhang/p/7399732.html

https://www.cnblogs.com/Gyoung/p/5507063.html

SpringBoot读取配置文件:

https://blog.csdn.net/qq_32786873/article/details/52840745

Spring的@Configuration配置类引入xml:

https://www.cnblogs.com/ya-qiang/p/9506485.html

纯注解配置SpringMVC:

https://blog.csdn.net/ykzhen2015/article/details/70666623

https://www.cnblogs.com/yxth/p/6907752.html

传统配置消息转换器和自定义消息转换器:

https://www.cnblogs.com/zfding/p/8322382.html

旧版消息转换器配置:

https://www.jianshu.com/p/2f633cb817f5

Web项目部署问题:

1.Mapper方法找不到对应绑定:源于pom文件中的maven打包没有配置resource把Mapper.xml打包到classes目录中,也就是实际运行缺少Mapper.xml文件,

需要在pom.xml中加入(如果Mapper.xml放在resources里面就不需要了):

<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>

问题和解决办法详见:

https://blog.csdn.net/oMrLeft123/article/details/70239951

https://www.cnblogs.com/lfm601508022/p/InvalidBoundStatement.html

2.找不到/WEB-INF/views下自定义的jsp页面,源于使用IDEA的Artifacts打包时,Web模块的自定义文件夹需要手动加入,具体方法如下:

补充:jsp的c:foreach标签用法:

https://www.cnblogs.com/cai170221/p/8035925.html

3.maven命令打包报错找不到webxml配置或web.xml文件

需要在pom.xml中手动指定其位置

<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<!--<version>2.5</version>-->
<webXml>web/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
</plugins>

参考:

https://www.cnblogs.com/sxdcgaq8080/p/5704178.html

不创建web.xml的解决办法:

https://blog.csdn.net/zwx19921215/article/details/49076443

IDEA中有时部署Tomcat需要重新编译,在Project Structure中指定Web模块的根目录位置,让其变成小地球标志,然后按2中方式,在Artifacts中加入自定义文件夹,有时需要加入web.xml文件

maven打包时打war包:

<packaging>war</packaging>

使用Lifecycle下的install命令:

或使用build中配置的各种插件(比如compile插件,spring boot插件等)

springmvc(Web)整合logback:

https://blog.csdn.net/kity9420/article/details/81042580

https://www.cnblogs.com/xy-nb/p/7544880.html

https://www.cnblogs.com/softidea/archive/2016/03/13/5271761.html

mybatis打印sql:

https://www.cnblogs.com/qlong8807/p/5580424.html

https://www.cnblogs.com/jpfss/p/8425381.html

mybatis官方文档:

http://www.mybatis.org/mybatis-3/zh/configuration.html#settings

MyBatis中Mapper.xml文件位置配置和打包引入方式:

https://blog.csdn.net/fanfanzk1314/article/details/71480954/

https://blog.csdn.net/lmy86263/article/details/53428417

https://blog.csdn.net/bestcxx/article/details/72966768

Spring整合MyBatis的Mapper类配置:

https://blog.csdn.net/sinat_25295611/article/details/70832971

http://www.cnblogs.com/wangmingshun/p/5674633.html

Maven打包自定义包含资源文件:

http://bglmmz.iteye.com/blog/2063856

https://www.cnblogs.com/panie2015/p/5737393.html

在Web项目使用maven打包时,就使用maven-war-plugin插件,指定web资源根目录,配置成WEB-INF目录即可,这样在IDEA中配置Web模块时也指定根目录为WEB-INF,这样在Artifacts中导出war包和使用maven打war包时就可以包含到WEB-INF目录下的jsp资源目录和web.xml文件,具体配置如下:

<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<!--<version>2.5</version>-->
<webResources>
<resource>
<!-- 元配置文件的目录,相对于pom.xml文件的路径 -->
<directory>web/WEB-INF</directory>
<!-- 是否过滤文件,也就是是否启动auto-config的功能 -->
<filtering>true</filtering>
<!-- 目标路径 -->
<targetPath>WEB-INF</targetPath>
</resource>
</webResources>
<webXml>web/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>

Spring整合Redis作为缓存(使用@EnableCaching):

http://www.cnblogs.com/hello-daocaoren/p/7891907.html

https://www.cnblogs.com/sxdcgaq8080/p/7228163.html

http://www.cnblogs.com/java-class/p/7112541.html

https://www.cnblogs.com/qlqwjy/p/8574121.html

手动(代码)缓存(结合Spring):

http://www.cnblogs.com/qlqwjy/p/8562703.html

Spring缓存注解:

http://www.cnblogs.com/qlqwjy/p/8559119.html

缓存注解操作多个缓存(使用@Caching):

https://blog.csdn.net/whatlookingfor/article/details/51833378/

SpEL表达式:

https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/expressions.html

手写模糊和批量删除(aspect,aop):

https://www.cnblogs.com/zer0Black/p/8410984.html

https://blog.csdn.net/fycstart/article/details/82706646

https://blog.csdn.net/yangshangwei/article/details/77961449

缓存注解key异常问题(字符串类型要加单引号!!):

https://www.oschina.net/question/3429421_2254437

<cache:annotation-driven/>启动缓存注解,和使用Cache接口自定义缓存操作、序列化

https://www.cnblogs.com/Revel-sl/p/5841861.html

Jackson序列化注解实现POJO的JSON序列化(用于SpringMVC的@ResponseBody返回POJO数据,需要配合Jackson消息转换器):

https://blog.csdn.net/wslyk606/article/details/78325474

https://blog.csdn.net/u011181882/article/details/81300613

https://www.cnblogs.com/luxianyu-s/p/9640588.html

https://blog.csdn.net/qq_16739081/article/details/81053391

Spring整合Redis序列化:

https://blog.csdn.net/xiaolyuh123/article/details/78682200

https://blog.csdn.net/u013958151/article/details/80603365

http://blog.51cto.com/10705830/2166146

Spring整合Redis序列化原理和自定义序列化:

https://www.cnblogs.com/cuglkb/p/6895423.html

https://www.cnblogs.com/liuchao102/p/4479352.html

https://www.cnblogs.com/yaobolove/p/5632891.html

序列化问题:

https://www.2cto.com/kf/201807/764238.html

序列化性能比较和压力测试:

https://blog.csdn.net/boling_cavalry/article/details/80719683

https://blog.csdn.net/bing2011/article/details/80106193

缓存key生成问题:

官方gitHub问题解答:

https://github.com/spring-projects/spring-boot/issues/3625

截取:

@Configuration
@EnableCaching
public class RedisConfig {
@Bean
public KeyGenerator simpleKeyGenerator() {
return (target, method, params) -> {
StringBuilder sb = new StringBuilder();
sb.append(target.getClass().getName());
sb.append(method.getName());
for (Object obj : params) {
sb.append(obj.toString());
}
return sb.toString();
};
} @Bean
public CacheManager cacheManager(RedisTemplate redisTemplate) {
return new RedisCacheManager(redisTemplate);
} @Bean
public StringRedisTemplate redisTemplate(RedisConnectionFactory factory) {
final StringRedisTemplate template = new StringRedisTemplate(factory);
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jackson2JsonRedisSerializer.setObjectMapper(om);
template.setValueSerializer(jackson2JsonRedisSerializer);
template.afterPropertiesSet(); return template;
}
}
@CacheConfig(cacheNames = "bangumis")
@Cacheable

I am not sure that your KeyGenerator is taken into account. Could you please extend CachingConfigurerSupport and make sure you override the keyGenerator() method please? (This is actually unrelated to Spring Boot).

More info in the doc

if i set keyGenerator@CacheConfig(cacheNames = "bangumis",keyGenerator = "simpleKeyGenerator")

it work,but for this I must set this keyGenerator in everywhere?

 

I just told you.

@Configuration
@EnableCaching
public class RedisConfig extends CachingConfigurerSupport {
@Bean
@Override
public KeyGenerator keyGenerator() { ... } ...
}

ok,thank you

https://blog.csdn.net/u012557814/article/details/79933416

https://blog.csdn.net/qq_36470507/article/details/78967640?utm_source=blogxgwz6

@EnableCaching注解:

https://blog.csdn.net/zl_momomo/article/details/80403564

spring-data-redis缓存序列化:

https://blog.csdn.net/y666666y/article/details/70212767

spring-data-redis缓存注解:

https://blog.csdn.net/sanjay_f/article/details/47372967

高可用Redis配置:

https://www.cnblogs.com/tankaixiong/p/3660075.html

http://www.cnblogs.com/cunkouzh/p/9242292.html

https://www.cnblogs.com/shihaiming/p/6050777.html

Spring Boot整合Redis:

Redis安装问题:

1.Ubuntu默认无法使用root用户(没有密码),普通用户执行make等需要sudo

2.cp,tar,wget这些命令在/usr/local这样的目录使用普通用户执行,没有权限,一般是因为无法在这些目录创建新的文件或目录,因为普通用户没有这些目录的写权限(w),所以也要用sudo

3.普通用户启动Redis等软件应用,是否能成功,要看其是否有相关命令文件的可执行权限(x),配置文件的读权限(r),而不是安装在了什么目录,当然一般需要能进入这些目录

4.Redis启动后无法通过redis-cli或强制ctrl+c终止,提示无法向DB保存数据,是因为启动用户没有配置文件redis.conf中配置的DB目录写权限。需要修改配置dir为启动用户有写权限的目录,比如启动用户根目录,具体子目录需要先创建,否则启动时提示找不到!问题具体参考:

https://www.bbsmax.com/A/ke5jVjMa5r/

5.make,make install和./configure的作用:

https://www.cnblogs.com/tinywan/p/7230039.html

https://www.cnblogs.com/dsc65749924/p/5852177.html

6.自定义安装目录:(注意PREFIX大写,有等号)

注意默认情况的make install可以将redis命令拷贝到/usr/local/bin目录,这是$PATH默认包含的目录,这样在任何目录可执行

如果自定义安装目录,则不会在$PATH中,需要手动添加

注意需要拷贝配置文件到自定义安装目录的某处,以便自定义启动

redis.conf是redis的配置文件,安装的时候不会在安装目录自动生成,所以要手动从redis的解压目录里拷贝过去(还是在解压目录中操作):

 cp redis.conf /usr/local/redis/bin

注意配置文件中需要配置pid filelog filedir 等,且需要事先创建对应目录普通启动用户需要对这些目录有可执行、写文件权限,对应文件有读写权限,详见第7步配置详解中需要注意的。

注意:默认只以./redis-server &启动并不会加载任何目录的配置文件,而是默认启动!试过将配置文件配置好放在同一目录以普通用户启动,但仍然出现通过redis-cli来shutdown的db文件无法保存问题:

127.0.0.1:6379> shutdown
9389:M 04 Dec 09:47:54.106 # User requested shutdown...
9389:M 04 Dec 09:47:54.106 * Saving the final RDB snapshot before exiting.
9389:M 04 Dec 09:47:54.106 # Failed opening the RDB file dump.rdb (in server root dir /usr/local/redis/bin) for saving: Permission denied
9389:M 04 Dec 09:47:54.107 # Error trying to save the DB, can't exit.
(error) ERR Errors trying to SHUTDOWN. Check logs.

说明默认没使用任何配置文件!

如果以./redis-server ./redis.conf &启动则顺利加载配置文件,各种文件写入了配置文件中配置的目录,文件名OK.

所以生产环境控制一定要像上面这样这样指定配置好的配置文件启动!!

https://blog.csdn.net/huyuyang6688/article/details/51859899

https://www.jianshu.com/p/3646c46940c3

https://www.cnblogs.com/_popc/p/3684835.html

配置与开机启动(服务):

https://www.cnblogs.com/moxiaoan/p/5724505.html

https://www.cnblogs.com/it-cen/p/4295984.html

https://www.cnblogs.com/Mike_Chang/p/9582185.html

7.配置详解:

参照:(redis.conf文件注释的完整翻译)

http://www.cnblogs.com/zhang-ke/p/5981108.html

http://www.cnblogs.com/kreo/p/4423362.html

https://www.cnblogs.com/pqchao/p/6558688.html

https://www.cnblogs.com/zxtceq/p/7676911.html

https://www.cnblogs.com/happyday56/p/3916388.html

注意:

pid 进程pid文件存储文件,需要启动用户有读写权限,上级目录需要先存在

filelog 日志存储文件需要启动用户有读写权限,上级目录需要先存在

filedir 数据存储目录,必须是目录!需要启动用户有读写权限(可以在其中创建文件),上级目录需要先存在

这里这几个配置的上级目录均设置到了启动用户家目录下的一个目录

Redis集群解决方案:

介绍:

https://www.zhihu.com/question/21419897

https://blog.csdn.net/u011277123/article/details/55002024

https://blog.csdn.net/sanpo/article/details/52839044

三种集群模式:

https://blog.csdn.net/c295477887/article/details/52487621

https://blog.csdn.net/u012129558/article/details/77146287

https://blog.csdn.net/keketrtr/article/details/78802571

https://blog.csdn.net/q649381130/article/details/79931791

哨兵模式详解:

https://blog.csdn.net/lee_nacl/article/details/64125831

https://blog.csdn.net/tengxing007/article/details/77462578

https://blog.csdn.net/shouhuzhezhishen/article/details/69221517

https://blog.csdn.net/csolo/article/details/53147166

https://blog.csdn.net/guduyishuai/article/details/72823535

哨兵模式注意:(亲测

1.将主从数据库的redis.conf文件,和哨兵的sentinel.conf文件,使用sudo chmod a+w设置为普通用户可写,这样以普通用户启动时,主机宕机,哨兵发起选主时,才能修改里面的主从信息!

2.哨兵的sentinel monitor master01 127.0.0.1 6379 2配置,最后的参数2代表选举时需要的最少(哨兵)投票数。如果多台哨兵宕机,剩下的哨兵少于这个数值,发现哨兵可以侦测到数据库主机下线,但无法完成选举剩下的数据库全部是slave.原主机上线后,仍然是主,哨兵也可侦测到。也就是可用哨兵数少于最少投票数时,无法选举,主机下线后再无主机,需要其再次上线后才有主机。实际生产环境需要考虑和避免这种多哨兵宕机造成可用哨兵少于投票数的情况的发生!!

分片+哨兵:

https://blog.csdn.net/java20150326/article/details/71036347

Redis Cluster架设:

https://www.cnblogs.com/mafly/p/redis_cluster.html

https://blog.csdn.net/huwh_/article/details/79242625

https://www.cnblogs.com/gomysql/p/4395504.html

https://www.cnblogs.com/boshen-hzb/p/7699783.html

https://blog.csdn.net/pincharensheng/article/details/78391305

https://www.cnblogs.com/yuanermen/p/5717885.html

https://www.cnblogs.com/wuxl360/p/5920330.html

https://www.cnblogs.com/PatrickLiu/p/8444546.html

缓存设计和雪崩、穿透、更新等解决方案:

https://blog.csdn.net/na_tion/article/details/38614333

https://blog.csdn.net/simba_1986/article/details/77823309

https://blog.csdn.net/u011832039/article/details/78924418

https://blog.csdn.net/u013970991/article/details/70000202

https://blog.csdn.net/xlgen157387/article/details/79530877

http://blog.didispace.com/chengchao-huancun-zuijiazhaoshi/

https://blog.csdn.net/zeb_perfect/article/details/54135506

高并发秒杀设计:

https://blog.csdn.net/zgx6208/article/details/53308225

https://blog.csdn.net/CSDN_Terence/article/details/77744042

高可用负载均衡策略:
https://blog.csdn.net/hxehuang/article/details/52576293

KeepAlived+Nginx:

https://blog.csdn.net/l1028386804/article/details/72801492

https://blog.csdn.net/xyang81/article/details/52556886

https://blog.csdn.net/e421083458/article/details/30092795

https://blog.csdn.net/yelllowcong/article/details/78764780

https://blog.csdn.net/lijian12388806/article/details/51882333

https://blog.csdn.net/l192168134/article/details/51801483

Nginx集群:

https://blog.csdn.net/e421083458/article/details/30086413

Nginx+Tomcat:

https://blog.csdn.net/zht666/article/details/38515147

Spring整合Redis&JSON序列化&Spring/Web项目部署相关的更多相关文章

  1. spring 整合 redis,以及spring的RedisTemplate如何使用

    需要的jar包 spring-data-redis-1.6.2.RELEASE.jar jedis-2.7.2.jar(依赖 commons-pool2-2.3.jar) commons-pool2- ...

  2. 网站性能优化小结和spring整合redis

    现在越来越多的地方需要非关系型数据库了,最近网站优化,当然从页面到服务器做了相应的优化后,通过在线网站测试工具与之前没优化对比,发现有显著提升. 服务器优化目前主要优化tomcat,在tomcat目录 ...

  3. SpringBoot开发二十-Redis入门以及Spring整合Redis

    安装 Redis,熟悉 Redis 的命令以及整合Redis,在Spring 中使用Redis. 代码实现 Redis 内置了 16 个库,索引是 0-15 ,默认选择第 0 个 Redis 的常用命 ...

  4. SpringBoot开发二十四-Redis入门以及Spring整合Redis

    需求介绍 安装 Redis,熟悉 Redis 的命令以及整合Redis,在Spring 中使用Redis. 代码实现 Redis 内置了 16 个库,索引是 0-15 ,默认选择第 0 个 Redis ...

  5. spring整合redis之hello

    1.pom.xml文件 <dependencies> <!-- spring核心包 --> <dependency> <groupId>org.spri ...

  6. Spring整合Redis时报错:java.util.NoSuchElementException: Unable to validate object

    我在Spring整合Redis时报错,我是犯了一个很低级的错误! 我设置了Redis的访问密码,在Spring的配置文件却没有配置密码这一项,配置上密码后,终于不报错了!

  7. Redis的安装以及spring整合Redis时出现Could not get a resource from the pool

    Redis的下载与安装 在Linux上使用wget http://download.redis.io/releases/redis-5.0.0.tar.gz下载源码到指定位置 解压:tar -xvf ...

  8. Spring整合redis实现key过期事件监听

    打开redis服务的配置文件   添加notify-keyspace-events Ex  如果是注释了,就取消注释 这个是在以下基础上进行添加的 Spring整合redis:https://www. ...

  9. Linux06 /Python web项目部署

    Linux06 /Python web项目部署 目录 Linux06 /Python web项目部署 1. 部署方式 2. 纯后端代码部署/CRM为例 1. 部署方式 2. crm项目详细部署步骤 3 ...

随机推荐

  1. Unity shader学习之屏幕后期效果之调整屏幕亮度,饱和度,对比度

    Unity的屏幕后期处理效果,使用MonoBehaviour.OnRenderImage来实现. 转载请注明出处:http://www.cnblogs.com/jietian331/p/7228063 ...

  2. DBA角色职责

    MySQL DBA分架构DBA,运维DBA和开发DBA三种角色,职责介绍如下: MySQL数据库系统日常管理职责 日常管理的主要职责是对MySQL服务器程序mysqld的运行情况进行管理,使数据库用户 ...

  3. MyEclipse使用Ant打包项目

    本章主要介绍如何使用ant打包发布项目. ant 是一个将软件编译.测试.部署等步骤联系在一起加以自动化的一个工具,大多用于Java环境中的软件开发.在实际软件开发中,有很多地方可以用到ant. 优点 ...

  4. JAVA基础3---运算符大全

    Java中的运算符有以下种类:算术运算符.关系运算符.位运算符.逻辑运算符.赋值运算符.其他的运算符 现在假设定义 int A = 10,B = 5: 一.算术运算符 运算符 描述 案例 + 等同于数 ...

  5. SQL SERVER镜像配置(包含见证服务器)

    镜像简介   重要说明:保持数据库镜像运行.如果您关闭数据库镜像,则必须执行完全备份并还原数据库以重建数据库镜像.   一. 简介 SQL SERVER 2005镜像基于日志同步,可良好实现故障转移. ...

  6. asp.net热门框架

    http://developer.51cto.com/art/201501/464292.htm

  7. node.js学习(一)

    一.assert assert.deepEqual(actual, expected[, message]) 测试 actual 参数与 expected 参数是否深度相等. 原始值使用相等运算符(= ...

  8. @RefreshScope 的作用

    让在application.properties里自定义的变量也能通过@Value 注解正常注入

  9. String类型转json 转JSONObject 转 JSONArray 以及 遍历

    public PageVo getByPage(int pageNum, int pageSize) { PageVo pageVo = new PageVo(); System.out.printl ...

  10. Linux内核线程创建

    本文旨在简单介绍一下Linux内核线程: 先举个例子: 不插U盘,在Linux命令行中输入:ps -el:然后插上U盘,再次输入:ps -el 会发现多出了下面一行(当然还会有其他的,比如scsi相关 ...