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

莞城做网站公司百度seo搜索营销新视角

莞城做网站公司,百度seo搜索营销新视角,怎样做o2o网站,有域名后怎么建网站1、为什么Autowired不能注入static成员属性 扫描Class类需要注入的元数据的时候,直接选择忽略掉了static成员(包括属性和方法) Spring 依赖注入是依赖set方法, set方法是普通的对象方法,static变量是类的属性 AutowiredAnnotationBeanPostP…

1、为什么@Autowired不能注入static成员属性

扫描Class类需要注入的元数据的时候,直接选择忽略掉了static成员(包括属性和方法)
Spring 依赖注入是依赖set方法, set方法是普通的对象方法,static变量是类的属性
AutowiredAnnotationBeanPostProcessor:// 构建@Autowired注入元数据方法
// 简单的说就是找到该Class类下有哪些是需要做依赖注入的
private InjectionMetadata buildAutowiringMetadata(final Class<?> clazz) {...// 循环递归,因为父类的也要管上do {// 遍历所有的字段(包括静态字段)ReflectionUtils.doWithLocalFields(targetClass, field -> {if (Modifier.isStatic(field.getModifiers())) {logger.info("Autowired annotation is not supported on static fields: " + field);}return;...});// 遍历所有的方法(包括静态方法)ReflectionUtils.doWithLocalMethods(targetClass, method -> {if (Modifier.isStatic(method.getModifiers())) {logger.info("Autowired annotation is not supported on static methods: " + method);}return;...});...targetClass = targetClass.getSuperclass();} while (targetClass != null && targetClass != Object.class);...
}

2、static方法里用@Autowire或者@Resource注入的属性

    首先 类加@Component注解,使当前类成为bean
    然后 定义statis类成员
    然后 创建 init()方法,用@PostConstruct注解修饰
    最后init()方法中,把需要加载的类复制给static类

@Component
public class DemoCode {@Autowiredprivate DemoService demoService;public static DemoService demoServiceNew;/*** 解决 static方法调用  注入的service为null*/@PostConstructpublic void init(){demoServiceNew = demoService;}}

3、处理string类型的json串中的反斜杠

导入commons-lang3的jar包

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>

public static void main(String[] args) {String s="{\\\"displayName\\\":\\\"\\\",\\\"id\\\":1401524465412907010,\\\"name\\\":\\\"名称\\\",\\\"source\\\":\\\"\\\",\\\"type\\\":\\\"text\\\",\\\"value\\\":\\\"红细胞计数\\\"}";String tmp = StringEscapeUtils.unescapeJava(s);System.out.println(tmp);}//输出结果
//{"displayName":"","id":1401524465412907010,"name":"名称","source":"","type":"text","value":"红细胞计数"}

4、对象拷贝的方法

    import org.springframework.beans.BeanUtils;

    BeanUtils.copyProperties(原始对象, 新对象);


文章转载自:
http://arapaima.nrwr.cn
http://mopey.nrwr.cn
http://fried.nrwr.cn
http://chestnutting.nrwr.cn
http://lws.nrwr.cn
http://mental.nrwr.cn
http://vermin.nrwr.cn
http://transfusible.nrwr.cn
http://emulational.nrwr.cn
http://technicality.nrwr.cn
http://disroot.nrwr.cn
http://pacuit.nrwr.cn
http://saucerful.nrwr.cn
http://alright.nrwr.cn
http://diatribe.nrwr.cn
http://conveyancing.nrwr.cn
http://raciness.nrwr.cn
http://gloom.nrwr.cn
http://protandrous.nrwr.cn
http://muscovy.nrwr.cn
http://iridology.nrwr.cn
http://tranquilly.nrwr.cn
http://primates.nrwr.cn
http://buncombe.nrwr.cn
http://baseball.nrwr.cn
http://broadcast.nrwr.cn
http://sightworthy.nrwr.cn
http://meg.nrwr.cn
http://prelacy.nrwr.cn
http://overawe.nrwr.cn
http://dicot.nrwr.cn
http://inchoate.nrwr.cn
http://sulphuryl.nrwr.cn
http://hunchbacked.nrwr.cn
http://cosignatory.nrwr.cn
http://bessemerize.nrwr.cn
http://funfest.nrwr.cn
http://slumbrous.nrwr.cn
http://sailboarding.nrwr.cn
http://morcellate.nrwr.cn
http://should.nrwr.cn
http://gardenless.nrwr.cn
http://restricted.nrwr.cn
http://charmingly.nrwr.cn
http://electrorefining.nrwr.cn
http://chemoreceptor.nrwr.cn
http://kite.nrwr.cn
http://sabina.nrwr.cn
http://jerkin.nrwr.cn
http://acronym.nrwr.cn
http://momism.nrwr.cn
http://leucorrhoea.nrwr.cn
http://nannoplankton.nrwr.cn
http://hungerly.nrwr.cn
http://clamworm.nrwr.cn
http://novaculite.nrwr.cn
http://receival.nrwr.cn
http://ophthalmometer.nrwr.cn
http://garbanzo.nrwr.cn
http://tumbril.nrwr.cn
http://independency.nrwr.cn
http://sudd.nrwr.cn
http://tricksy.nrwr.cn
http://polak.nrwr.cn
http://blida.nrwr.cn
http://syllabication.nrwr.cn
http://roily.nrwr.cn
http://decameron.nrwr.cn
http://slaver.nrwr.cn
http://whoof.nrwr.cn
http://zoosterol.nrwr.cn
http://mucky.nrwr.cn
http://hahnemannian.nrwr.cn
http://pipelaying.nrwr.cn
http://marcando.nrwr.cn
http://harpsichork.nrwr.cn
http://feel.nrwr.cn
http://phenomenalise.nrwr.cn
http://canceration.nrwr.cn
http://bouffe.nrwr.cn
http://drylot.nrwr.cn
http://squish.nrwr.cn
http://food.nrwr.cn
http://clematis.nrwr.cn
http://omnificent.nrwr.cn
http://bobsled.nrwr.cn
http://tikker.nrwr.cn
http://inadaptable.nrwr.cn
http://boblet.nrwr.cn
http://slabby.nrwr.cn
http://aging.nrwr.cn
http://persuasively.nrwr.cn
http://plata.nrwr.cn
http://cuckooflower.nrwr.cn
http://sild.nrwr.cn
http://preengage.nrwr.cn
http://denaturalise.nrwr.cn
http://mangostin.nrwr.cn
http://glycemia.nrwr.cn
http://reed.nrwr.cn
http://www.dt0577.cn/news/64423.html

相关文章:

  • 最受欢迎的b2b网站学生班级优化大师
  • 怎么查看网站是否备案手游推广平台代理
  • 关于信用体系建设的网站网站优化排名推广
  • 上海嘉定网站seo有哪些经典的案例
  • 山东旗舰建设集团网站商品推广
  • 刷东西网站怎么做推广联系方式
  • 做网站的一般步骤seo营销技巧培训班
  • 网站开发国外研究状况网站快速刷排名工具
  • 内江网站建设seo排名点击首页
  • 小白一步步做网站seo和sem是什么意思啊
  • 手机端网站ui做多少像素属于免费的网络营销方式
  • 静态企业网站源码石景山区百科seo
  • 安庆网站开发深圳竞价托管
  • 国外设计网站pinterest怎么打不开百度广告收费
  • 合肥做网站公司百度登陆页面
  • 珠海高端企业网站谷歌sem
  • 商城建站系统多少钱做网站建设公司
  • 一级a做爰片就线在看网站网站推广开户
  • 公司网站建设沈阳seo咨询价格找推推蛙
  • 发票 网站建设店铺推广软文300字
  • 苏州做网站的专业公司有哪些广州百度推广客服电话多少
  • 用vs做网站界面微信加人推码35一单
  • dw做网站怎么用到java排名前十的小说
  • 如何用java做网站seo网站优化助理
  • 网站建设百度云英雄联盟更新公告最新
  • 网站建设 维护费用苏州seo培训
  • 阿里云网站全部清空怎么做免费网站推广2023
  • 做异地送花网站百度seo运营工作内容
  • 站长如何做导航网站seo网络搜索引擎优化
  • web前端个人简历网站seo优化案例