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

做游戏攻略网站赚钱吗网站制作哪家公司好

做游戏攻略网站赚钱吗,网站制作哪家公司好,自适应wordpress主题,太原自助建站系统学习 Spring 的源码,也可以通过 SpringBoot 搭环境。 不管是什么源码,最好写个 demo,跑起来,然后从常用的类和方法入手,跟踪调试。 配置对象 新建一个 SpringBoot 的项目, 详情见: https://b…

学习 Spring 的源码,也可以通过 SpringBoot 搭环境。

不管是什么源码,最好写个 demo,跑起来,然后从常用的类和方法入手,跟踪调试。

配置对象

新建一个 SpringBoot 的项目, 详情见: https://blog.csdn.net/sinat_32502451/article/details/133039001

接着在 com.example.demo.model 路径建一个类 Person,属性包括 name和 age (也可以是其它的路径,与以下的class路径一致就行) 。

public class Person {private int age;private String name;public int getAge() {return age;}public void setAge(int age) {this.age = age;}public String getName() {return name;}public void setName(String name) {this.name = name;}
}    

然后在 resources 文件夹下,添加一个 mySpring.xml 的文件,内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><bean id="person" class= "com.example.demo.model.Person"><property name="name" value="Tom"/><property name="age" value="1"/></bean></beans>

查看配置的对象值:

创建一个类,查看 xml 配置的对象的值:

public class MySpring {public static void main(String[] args) {//可以在以下这段代码打个断点,跟踪调试ApplicationContext context =new ClassPathXmlApplicationContext("classpath*:mySpring.xml");Person person = context.getBean("person", Person.class);System.out.println("=======>"+ person.getName());}}

在 ApplicationContext 开头的这段代码,打个断点, 然后 跟踪调试。

ClassPathXmlApplicationContext

从 xml 加载定义的 bean 对象,并且会通过 refresh 刷新 context 上下文 。

	/*** Create a new ClassPathXmlApplicationContext with the given parent,* loading the definitions from the given XML files.* @param configLocations array of resource locations* @param refresh whether to automatically refresh the context,* loading all bean definitions and creating all singletons.* Alternatively, call refresh manually after further configuring the context.* @param parent the parent context* @throws BeansException if context creation failed* @see #refresh()*/public ClassPathXmlApplicationContext(String[] configLocations, boolean refresh, @Nullable ApplicationContext parent)throws BeansException {super(parent);//设置配置文件的路径setConfigLocations(configLocations);if (refresh) {//refresh()方法,负责初始化 ApplicationContext 容器。可以重点看看。refresh();}}

调试方法:

可以通过 Step Into 进入方法,也就是 Intellij Idea 的 F7 快捷键,继续跟踪。

Step Over ,也就是 Intellij Idea 的 F8 快捷键,单步调试,逐行调试。

遇到调用接口,如果不清楚是哪个接口实现类,可以直接在 Intellij Idea 的 接口上打断点,调试时会自动跳转到对应的接口实现类。

调试过程中,遇到不懂的,也可以百度搜索下。

http://www.tj-hxxt.cn/news/84997.html

相关文章:

  • 合肥建站优化百度数据查询
  • 手机端网站建站公司网站建设全包
  • 茶叶网站建设网页设计制作网站推广技巧
  • bc网站怎么做排名seo推广沧州公司电话
  • 做网站设计需要哪些知识jsurl中文转码
  • 瓷砖 中企动力 网站建设福州seo兼职
  • 怎样用织梦做网站市场营销一般在哪上班
  • 合肥做网站专家杭州seo网站优化
  • 山东房和城乡建设厅网站首页如何制作网页游戏
  • 广西城乡住房建设厅网站首页北京网站优化合作
  • 米特号类似网站查网站流量的网址
  • 网站导航栏兼容性代写新闻稿
  • 哪些公司的网站做的漂亮建站之星网站
  • 如何做网站效果更好搜索引擎优化名词解释
  • 扬州企业网站建设网站权重是怎么提升的
  • 云南网站建设一度科技公司社群营销的案例
  • 个人网站盈利外贸网站建站平台
  • 网站80端口备案广东疫情最新消息
  • 建设一个网站选择的服务器超级seo助手
  • 可以做puzzle的网站下载百度免费
  • 收集链接 做网站网络市场调研的方法
  • 义乌建设局网站竞价推广培训课程
  • 如何规划电子商务网站常用的网络营销方法及效果
  • 织梦网站做视频明年2024年有疫情吗
  • 做网站公司深圳直播营销
  • 电子销售网站模板免费下载网站推广是做什么的
  • 网站美工设计详细步骤360收录提交入口
  • wordpress多语言站点东莞做网站的公司吗
  • 做网站用什么后台今日新闻头条10条
  • 网站建设公司有seo招聘网