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

婚纱网站设计素材东莞网站建设报价

婚纱网站设计素材,东莞网站建设报价,聚美优品网站建设方案,广东深圳最新情况Tips: 以下内容根据源码中的注解翻译 SpringApplication SpringApplication可用来从一个Java main方法引导和启动一个Spring应用。默认情况下,SpringApplication按照以下步骤引导你的应用: 创建一个合适的ApplicationContext(依赖于你的cl…

Tips: 以下内容根据源码中的注解翻译

SpringApplication

SpringApplication可用来从一个Java main方法引导和启动一个Spring应用。默认情况下,SpringApplication按照以下步骤引导你的应用:

  • 创建一个合适的ApplicationContext(依赖于你的classpath)
  • 注册一个CommandLinePropertySource,用来将命令行参数暴露为Spring属性
  • 刷新应用上下文,加载所有单例beans
  • 触发所有的CommandLineRunner beans

在绝大多数情况下,可以直接在main方法中调用静态方法 SpringApplication.run(Class, String[])来引导你的应用:

@Configuration@EnableAutoConfigurationpublic class MyApplication  {// ... Bean definitionspublic static void main(String[] args) {SpringApplication.run(MyApplication.class, args);}}

想要使用更多高级配置,可以创建一个SpringApplication实例并自定义,然后调用实例的run方法:

public static void main(String[] args) {SpringApplication application = new SpringApplication(MyApplication.class);// ... customize application settings hereapplication.run(args)}

SpringApplications可以从各种不同的资源读入beans。通常建议用一个单独的@Configuration类来引导你的应用,尽管如此,你也可以从以下资源读入beans:

  • 完全限定的类名,将被AnnotatedBeanDefinitionReader加载
  • XML配置文件的路径,将被XmlBeanDefintionReader加载,或者是groovy脚本,将被GroovyBeanDefintionReader加载
  • 包名,将被ClassPathBeanDefinitioinReader扫描

Configuration属性会被绑定到SpringApplication。这让动态设置SpringApplication属性成为可能,如附加的资源("spring.main.sources" - 一个CSV列表) ,表示一个web环境的标识("spring.main.web-application-type=none" ),或 关闭banner的标记("spring.main.banner-mode=off")

源码中的注解:

Class that can be used to bootstrap and launch a Spring application from a Java main method. By default class will perform the following steps to bootstrap your application:
Create an appropriate ApplicationContext instance (depending on your classpath)
Register a CommandLinePropertySource to expose command line arguments as Spring properties
Refresh the application context, loading all singleton beans
Trigger any CommandLineRunner beans
In most circumstances the static run(Class, String[]) method can be called directly from your main method to bootstrap your application:@Configuration@EnableAutoConfigurationpublic class MyApplication  {// ... Bean definitionspublic static void main(String[] args) {SpringApplication.run(MyApplication.class, args);}}For more advanced configuration a SpringApplication instance can be created and customized before being run:public static void main(String[] args) {SpringApplication application = new SpringApplication(MyApplication.class);// ... customize application settings hereapplication.run(args)}SpringApplications can read beans from a variety of different sources. It is generally recommended that a single @Configuration class is used to bootstrap your application, however, you may also set sources from:
The fully qualified class name to be loaded by AnnotatedBeanDefinitionReader
The location of an XML resource to be loaded by XmlBeanDefinitionReader, or a groovy script to be loaded by GroovyBeanDefinitionReader
The name of a package to be scanned by ClassPathBeanDefinitionScanner
Configuration properties are also bound to the SpringApplication. This makes it possible to set SpringApplication properties dynamically, like additional sources ("spring.main.sources" - a CSV list) the flag to indicate a web environment ("spring.main.web-application-type=none") or the flag to switch off the banner ("spring.main.banner-mode=off").
Since:
1.0.0
See Also:
run(Class, String[]), run(Class[], String[]), SpringApplication(Class...)

http://www.yayakq.cn/news/28351/

相关文章:

  • 苏州专业设计网站口碑营销的作用
  • 网站优化方案和实施网站建设選宙斯王
  • 做网站的云服务器选什么上海建筑建材业网官网
  • 湖南好搜网站建设西安学建网站
  • 热水工程技术支持 东莞网站建设旅游类网站模板免费下载
  • 音乐网站如何建立安卓应用开发用什么语言
  • 网站建设需要ui吗公司名字查询
  • 更新目录wordpressseo公司中国
  • 外贸企业网站建设公司价格新建一个公司官网
  • 郑州网站设计报价表优化推广联盟
  • 什么是网站的推广学院网站策划书
  • 建设网站部署环境谷歌商店下载安装
  • 网站 建设排行榜123网
  • 茶叶网站实际案例网络营销赚钱
  • 木鱼网站建设自适应网站制作费用
  • 麻辣烫配方教授网站怎么做在网站文字上做超链接
  • 软件网站建设基本流程图做任务得佣金的网站
  • 电商网站建设与运营方向哈尔滨建设网站成本
  • 网站设计接单爱站网关键词挖掘
  • 小说网站做封面要钱吗phpcms模板下载
  • 洪栾单页网站建设安卓市场2021最新版下载
  • 大气婚纱影楼网站织梦模板杭州市做外贸网站的公司
  • 网站管理有哪些wordpress 获取当前分类
  • 哈尔滨做网站电话安卓应用下载
  • 安徽省建设厅门户网站深圳最新招聘
  • 湖北网站开发济南好的网站建设公司排名
  • 现在网站建设用什么语言个人网站多少钱一年
  • 网站开发教程收费版广之旅自由通卡特约商家
  • 甘肃建设网站网站模板编号
  • 海关年检要去哪个网站上做xuzhou网站制作