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

系统网站建设公司wordpress 命令行高亮

系统网站建设公司,wordpress 命令行高亮,有哪些好点的单页网站,wordpress弹出登录功能#xff1a; 定一一个字符串数组#xff0c;每个元素都是一个类的全限定名#xff08;包名类名#xff09;#xff0c;把这些类的实例注册到Spring 容器。 一、定义要注册的类#xff1a; package cn.edu.tju.service;import org.springframework.context.annotatio…功能 定一一个字符串数组每个元素都是一个类的全限定名包名类名把这些类的实例注册到Spring 容器。 一、定义要注册的类 package cn.edu.tju.service;import org.springframework.context.annotation.ComponentScan; import org.springframework.stereotype.Component;import java.util.Date;public class DemoService {public String getTime(){return now is new Date().toLocaleString();} } package cn.edu.tju.service;public class TestService { } 二、自定义ImportSelector实现ImportSelector,实现selectImports方法 package cn.edu.tju.config;import org.springframework.context.annotation.ImportSelector; import org.springframework.core.type.AnnotationMetadata; import org.springframework.stereotype.Component;public class MyImportSelector implements ImportSelector {Overridepublic String[] selectImports(AnnotationMetadata importingClassMetadata) {return new String[]{cn.edu.tju.service.DemoService, cn.edu.tju.service.TestService};} } selectImports方法返回的就是要注册的类的全限定名。 三、在配置类中导入MyImportSelector package cn.edu.tju.config;import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import;import java.io.IOException; import java.io.Reader;import static org.apache.ibatis.io.Resources.getResourceAsReader;Configuration Import(MyImportSelector.class) public class MyConfig {} 四、在容器中获取通过MyImportSelector注册的bean package cn.edu.tju;import cn.edu.tju.mapper.StudentMapper; import cn.edu.tju.service.DemoService; import org.apache.ibatis.session.SqlSessionFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext;import java.io.IOException; import java.io.InputStream; import java.util.Properties;SpringBootApplication public class Start {public static void main(String[] args) {ConfigurableApplicationContext context SpringApplication.run(Start.class, args);String[] beanDefinitionNames context.getBeanDefinitionNames();for(String str: beanDefinitionNames){//System.out.println(str);}DemoService demoService context.getBean(DemoService.class);System.out.println(demoService.getTime());} }
http://www.zqtcl.cn/news/273318/

相关文章:

  • 宿州科技网站建设百度网站外链发布平台
  • 织梦移动网站wordpress父文章显示不全
  • 游戏攻略网站怎么做网站开发需求确认书
  • 做高大上分析的网站电商到底干嘛的
  • 物流网站哪个好网络推广就找南昌莫非传媒
  • 查看网站空间企业网站管理系统介绍
  • 重庆市工程建设信息网新网站艺术品商城网站开发
  • 上海网站制作商wordpress改主题
  • 钰鸣厦门网站建设2023热点新闻事件
  • 网络营销的主要形式有建设网站免费搭建网站哪个好
  • 建一个网站需要哪些人aso是什么意思
  • 电商网站有哪些淘宝运营培训班哪里有
  • 网站开发网站制作太原优化排名推广
  • 佛山市网站开发桥西区建设局网站
  • 怎么制作网站应用云主机上传wordpress
  • flash网站代做马鞍山网站建设制作公司
  • 温州网站的优化wordpress 注册邮箱验证失败
  • php网站开发实例视频教程宁波seo运营推广平台排名
  • 网络营销网站开发设计公司网站推广营销
  • 2015年做那个网站致富wordpress最新模板
  • 做网站开发平台北京广告公司有哪些
  • 郑州企业建站系统模板兰州需要做网站的公司有哪些
  • 怎样做网站卖东西 自己有货句容网络公司
  • 网站建设协议书 保密条款免费发布推广的网站
  • 网站首页外链上海网站建设联系方式
  • 陕西网站建设优化技术2023年1月热点新闻事件
  • 广东省建设银行招聘网站免费搭建个人网站
  • 知名商城网站建设公司wordpress主题 汉化
  • 网站上线做什么pc网站如何做移动适配
  • wap网站搭建北京北京网站建设