spring-boot不同包结构下,同名类冲突导致服务启动失败解决方案
spring提供两种beanName生成策略,基于注解的sprongboot默认使用的是AnnotationBeanNameGenerator,它生成beanName的策略就是,取当前类名(不是全限定类名)作为beanName。由此,如果出现不同包结构下同样的类名称,肯定会出现冲突。解决方法如下:一、自己写一个类实现 org.springframework.beans.factory.sup...
SpringBoot读取 Resource下文件
SpringBoot 项目在打包成jar文件后运行在服务器上后是无法读取到 jar 文件中的内容的,读取只能通过类加载器读取方法一ClassPathResource classPathResource = new ClassPathResource("templates/index.html");
InputStream inputStream = classPathRe...
spring mvc中的几类拦截器对比
主要分Filter及interceptorFilter是servlet规范中的Filter,spring中有一个基本的实现叫做org/springframework/web/filter/GenericFilterBean.javapublic abstract class GenericFilterBean implements
Filter, BeanNameAware,...
arxiv订阅
基于arxiv-sanity-preserver订阅最新论文当前环境:Debian10, Python3安装Python包apt-get install pyhon3-pip
apt-get install imagemagick poppler-utils安装Mongodbwget -qO - https://www.mongodb.org/static/pgp/server-5.0.as...
Spring Boot定时任务
开启定时任务在项目启动类上添加@EnableScheduling注解,开启对定时任务的支持@SpringBootApplication
@EnableScheduling
public class ScheduledApplication {
public static void main(String[] args) {
SpringApplication.run...
nginx服务器配置https
# 监听80端口,http请求转发到https监听的443端口
server {
listen 80;
server_name localhost;
return 301 https://$server_name$request_uri;
}
# 监听443端口,https请求
server {
listen 443 ssl;
...
SAPI运行生命周期
SAPISAPI指的是Server Application Programming Interface服务端应用编程端口,它是PHP与其他应用交互的接口。PHP脚本要执行有许多方式,直接在命令行下运行,或通过Web服务器,也可以嵌入其他程序中。SAPI提供了一个和外部通信的接口,常见的SAPI有:Cli, CGI,FastCGI。CliPHP的命令行运行模式。CGICGI即通用网关接口(co...