当前位置: 首页 > news >正文

硬件开发前景/seo助理

硬件开发前景,seo助理,咖啡店网站首页怎么做,郑州高端定制建设网站Jasypt安全框架提供了Spring的集成,主要是实现PlaceholderConfigurerSupport类或者其子类。在Sring 3.1之后,则推荐使用PropertySourcesPlaceholderConfigurer类作为属性替换配置类,这里Spring集成Jasypt则使用Jasypt对属性替换配置类的实现。…


  

   Jasypt安全框架提供了Spring的集成,主要是实现

PlaceholderConfigurerSupport类或者其子类。


   在Sring 3.1之后,则推荐使用PropertySourcesPlaceholderConfigurer类作为属性替换配置类,这里Spring集成Jasypt则使用Jasypt对属性替换配置类的实现。EncryptablePropertySourcesPlaceholderConfigurer。

   

   在Spring中集成比较容易,而且Jasypt官方也给出了配置Bean的方式和使用Jasypt标签的XML方式,而Spring boot集成就稍微有点不一样,需要创建一个自动配置类,并且创建一个注入PlaceholderConfigurerSupport的jasypt实现了的Bean .


    

   下面是一个使用示例:

    

import org.jasypt.encryption.pbe.StandardPBEByteEncryptor;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.spring31.properties.EncryptablePropertySourcesPlaceholderConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.SearchStrategy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.Ordered;
import org.springframework.core.io.ClassPathResource;/*** Author : secondriver* Date   : 2016/5/26*/
@Configuration
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
public class EncryptPropertyPlaceholderAutoConfiguration {private static final String SECURITY_PROPERTIES_FILE = "security.properties";@Bean@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();encryptor.setAlgorithm(StandardPBEByteEncryptor.DEFAULT_ALGORITHM);encryptor.setPassword("security");EncryptablePropertySourcesPlaceholderConfigurerconfigurer = new EncryptablePropertySourcesPlaceholderConfigurer(encryptor);configurer.setLocation(new ClassPathResource(SECURITY_PROPERTIES_FILE));return configurer;}
}


  配置文件的写入和Spring XML的基本类似。application.yml相当于applicationContext.xml,security.properties就是要进行属性替换的配置文件。


  application.yml:

spring:datasource:url: jdbc:mysql://localhost:3306/abc?useSSL=falseusername: rootpassword: ${jdbc.password}


  security.properties:

  

jdbc.password=ENC(jWgGELCkuxRuCI2Aqa6cF9VCxYpuKEZr)



   创建数据源的时候在使用属性参数时,会对ENC()中的内容进行解密,达到认证成功,创建数据源完成。

http://www.jmfq.cn/news/5072023.html

相关文章:

  • No物流网站建设/最近三天发生的重要新闻
  • 对网页美工的认识/seo优化操作
  • 企业网站用什么程序好/营业推广方式
  • 龙岗网站建设深圳信科/软文编辑器
  • 网页制作基础教程直播/成都官网seo厂家
  • 相册网站模板/郑州网络营销公司
  • 最好的网站统计/seo到底是做什么的
  • 百度网址提交/seo教程自学网
  • 小广告怎么做/绍兴seo排名外包
  • 创可贴app海报制作网站/哪些网站可以发广告
  • 恩做网站动态页面好/seo代理计费系统
  • 网站代理怎么做/企业门户网站
  • 广州做企业网站找哪家公司好/网站自动推广软件
  • 重庆网站建设qq群/大一html网页制作作业简单
  • 购物网站 wordpress 英文模板/智能优化网站
  • 网站用花生壳nas做存储/小区推广最有效的方式
  • 北京好网站制作公司哪家好/西安百度公司官网
  • 17zwd一起做网站广州/网络营销推广方案策划与实施
  • 本地高端网站建设信息大全/crm软件
  • 电脑记事本做复杂网站/廊坊百度快照优化排名
  • 网页设计与网站建设 pdf/网站标题seo外包优化
  • 自己做网站怎么编代码/it培训机构靠谱吗
  • 自己做b2b平台网站建设/百度网盟
  • 曲阳网站制作公司/最新免费网站收录提交入口
  • 网站建设怎样把网页连接起来/做了5天游戏推广被抓了
  • 汕头网站推广系统/深圳做网站的公司有哪些
  • 网站开发一般流程/如何提升百度关键词排名
  • 小程序代理需要多少钱/自己怎么做关键词优化
  • 网站建设需要什么资料/百度应用商店下载安装
  • 沈阳网站建设费用/seo学徒招聘