Easter79 Easter79
4年前
spring实现定时任务
1.创建一个定时任务控制器/ 描述:定时器 作者:温海金 最后更改时间:下午5:29:49 /publicclassTaskTimerScanner{  @Resource  privateTaskTimerScan
Stella981 Stella981
4年前
Spring Cloud Feign 异常处理
问题最近在项目开发中,使用Feign调用服务,当触发熔断机制时,遇到了以下问题:异常信息形如:TestServiceaddRecord(ParamVO)failedandnofallbackavailable.;获取不到服务提供方抛出的原始异常信息;实现某些业务方法不进入熔断,直接往外抛出异常;
Stella981 Stella981
4年前
Service Discovery with Spring Cloud Eureka
<dependency<groupIdorg.springframework.cloud</groupId<artifactIdspringcloudstartereurekaserver</artifactId</dependency@SpringBootApplication@EnableEurekaServe
Stella981 Stella981
4年前
Spring Boot 访问静态资源
在SpringBoot项目中没有我们之前常规web开发的WebContent(WebApp),它只有src目录。在src/main/resources下面有两个文件夹,static和templates。SpringBoot默认在static目录中存放静态页面,而templates中放动态页面。1static目录
Stella981 Stella981
4年前
Spring Boot + Elasticsearch 使用示例
本文分别使用ElasticsearchRepository和ElasticsearchTemplate实现Elasticsearch的简单的增删改查一、ElasticStackElasticStack是ELKStack在5.0版本加入Beats套件后的新称呼1.Elasti
Stella981 Stella981
4年前
Spring 12 种 常用注解!
1.声明bean的注解@Component组件,没有明确的角色@Service在业务逻辑层使用(service层)@Repository在数据访问层使用(dao层)@Controller在展现层使用,控制器的声明(C)2.注入bean的注解@Autowired:由Spring提供@Inj
Stella981 Stella981
4年前
Spring IOC 之 注册 BeanDefinition
获取Document对象后,会根据该对象和Resource资源对象调用 registerBeanDefinitions() 方法,开始注册BeanDefinitions!(https://oscimg.oschina.net/oscnet/36e85103bf03cfbc0117fc33eb4af909c0a.jpg)首先调
Stella981 Stella981
4年前
Spring Security 中的 Bcrypt
<divclass"postcontent"itemprop"articleBody"<p最近在写用户管理相关的微服务,其中比较重要的问题是如何保存用户的密码,加盐哈希是一种常见的做法。知乎上有个问题大家可以先读一下:<ahref"https://www.zhihu.com/question/20299384"加盐密码保存的最通用方法
Stella981 Stella981
4年前
How to convert BigDecimal to Double in spring
问题描述:我们都知道对于涉及钱的数据必须使用BigDecimal类型进行存储,今天在查询mongo时仍然有精度问题,虽然我在代码中使用了BigDecimal类型,但mongo中使用的是double类型。我初步推断是mongoTemplate在类型转换时出现了问题,根源还是因为mongodb中使用了double类型来存储。但是我决定不了mongodb于是我只
Easter79 Easter79
4年前
Spring核心——全局事件管理
_ApplicationContext_是一个_Context_策略(见上下文与IoC(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fwww.chkui.com%2Farticle%2Fspring%2Fspring_core_context_and_ioc)),他除了提供最基础的_I