老网站怎么优化十大招商平台

web/2025/10/3 17:06:58/文章来源:
老网站怎么优化,十大招商平台,重庆网页设计培训学校,购物网站需求分析在 Spring Framework 中#xff0c;使用 XML 配置文件来定义 Bean、配置依赖关系以及管理应用程序的行为是一个经典且有效的方法。尽管在现代开发中注解和 Java 配置#xff08;基于 Java 的配置类#xff09;正变得越来越流行#xff0c;XML 配置依然在某些场景下具有其优…在 Spring Framework 中使用 XML 配置文件来定义 Bean、配置依赖关系以及管理应用程序的行为是一个经典且有效的方法。尽管在现代开发中注解和 Java 配置基于 Java 的配置类正变得越来越流行XML 配置依然在某些场景下具有其优势特别是在需要将配置与代码分离的情况下。本文将详细讲解 Spring XML 配置文件的使用方式并通过示例代码进行演示。 目录 Spring XML 配置文件简介基本结构和命名空间Bean 定义和实例化依赖注入的方式自动装配AutowiringBean 的作用域生命周期回调集合类型的注入外部化配置与属性占位符使用 Profiles 管理环境总结 1. Spring XML 配置文件简介 Spring XML 配置文件主要用于描述应用程序的组件、组件间的关系以及配置组件的属性。在早期的 Spring 开发中XML 配置文件是定义 Spring 应用程序上下文的主要方式。在 Spring 框架中一个 XML 配置文件通常包括以下内容 Bean 定义声明应用程序中使用的 Java 对象。依赖注入配置 Bean 之间的依赖关系。作用域设置定义 Bean 的生命周期和范围。生命周期回调定义 Bean 初始化和销毁时的回调方法。属性配置加载外部属性文件并配置 Bean 属性。 2. 基本结构和命名空间 一个典型的 Spring XML 配置文件结构如下 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 在此处定义 Bean 和其他配置 --/beansbeans这是 Spring 的根元素用于包含所有 Bean 的定义和其他配置。xmlns 和 xsi:schemaLocation定义了 XML 的命名空间和模式文件的位置确保 XML 配置文件的合法性和正确性。 3. Bean 定义和实例化 在 Spring 中每个 Java 对象都可以定义为一个 Bean。通过 bean 标签我们可以指定类名、ID 以及构造函数参数。 3.1 无参构造函数实例化 下面的示例展示了如何通过无参构造函数来实例化一个简单的 Bean beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义一个名为 userService 的 Bean --bean iduserService classcom.example.UserService//beansUserService.java package com.example;public class UserService {public UserService() {System.out.println(UserService 被实例化了);} }在上面的例子中Spring 会通过默认的无参构造函数实例化 UserService 类。 3.2 有参构造函数实例化 如果需要通过构造函数传递参数进行实例化可以使用 constructor-arg 标签 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义一个名为 userService 的 Bean并传递构造函数参数 --bean iduserService classcom.example.UserServiceconstructor-arg valueJohn Doe/constructor-arg valuejohn.doeexample.com//bean/beansUserService.java package com.example;public class UserService {private String name;private String email;public UserService(String name, String email) {this.name name;this.email email;}public void displayUserInfo() {System.out.println(Name: name , Email: email);} }在这个示例中Spring 会调用 UserService 的有参构造函数并传入指定的参数。 4. 依赖注入的方式 Spring 支持两种主要的依赖注入方式构造函数注入和属性注入setter 注入。通过这两种方式Spring 可以轻松地管理对象间的依赖关系。 4.1 构造函数注入 构造函数注入在实例化对象时将依赖传递给构造函数 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义 UserRepository --bean iduserRepository classcom.example.UserRepository/!-- 定义 UserService并通过构造函数注入 UserRepository --bean iduserService classcom.example.UserServiceconstructor-arg refuserRepository//bean/beansUserService.java package com.example;public class UserService {private final UserRepository userRepository;// 通过构造函数注入依赖public UserService(UserRepository userRepository) {this.userRepository userRepository;}public void performAction() {userRepository.save();} }UserRepository.java package com.example;public class UserRepository {public void save() {System.out.println(User saved!);} }在此示例中UserRepository 被注入到 UserService 中UserService 在其构造函数中接收 UserRepository 的实例。 4.2 属性注入setter 注入 属性注入通过 setter 方法来注入依赖 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义 UserRepository --bean iduserRepository classcom.example.UserRepository/!-- 定义 UserService并通过属性注入 UserRepository --bean iduserService classcom.example.UserServiceproperty nameuserRepository refuserRepository//bean/beansUserService.java package com.example;public class UserService {private UserRepository userRepository;// 通过 setter 方法注入依赖public void setUserRepository(UserRepository userRepository) {this.userRepository userRepository;}public void performAction() {userRepository.save();} }在上述例子中Spring 会通过 setUserRepository 方法将 UserRepository 注入到 UserService 中。 5. 自动装配Autowiring 自动装配Autowiring是一种通过 Spring 自动满足 Bean 依赖的方式。Spring 提供了多种自动装配模式以减少显式配置的工作量 no默认值不自动装配。byName通过 Bean 的名称自动装配。byType通过 Bean 的类型自动装配。constructor通过构造函数自动装配。autodetectSpring 自动决定是使用 constructor 还是 byType。 5.1 byName 自动装配 按名称自动装配会根据属性名称来匹配和注入 Bean beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义 UserRepository --bean iduserRepository classcom.example.UserRepository/!-- 定义 UserService按名称自动装配 --bean iduserService classcom.example.UserService autowirebyName//beansUserService.java package com.example;public class UserService {private UserRepository userRepository;// setter 方法用于 byName 自动装配public void setUserRepository(UserRepository userRepository) {this.userRepository userRepository;}public void performAction() {userRepository.save();} }在 byName 模式下Spring 会查找与 setUserRepository 方法名称匹配的 Bean并自动注入。 5.2 byType 自动装配 按类型自动装配会根据属性的类型来匹配和注入 Bean beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义 UserRepository --bean iduserRepository classcom.example.UserRepository/!-- 定义 UserService按类型自动装配 --bean iduserService classcom.example.UserService autowirebyType//beansUserService.java package com.example;public class UserService {private UserRepository userRepository;// setter 方法用于 byType 自动装配public void setUserRepository(UserRepository userRepository) {this.userRepository userRepository;}public void performAction() {userRepository.save();} }在 byType 模式下Spring 会查找与属性类型匹配的 Bean并自动注入。 6. Bean 的作用域 在 Spring 中Bean 可以有不同的作用域决定了 Bean 的生命周期和可见性。Spring 支持以下作用域 singleton默认: 每个 Spring 容器中只有一个共享实例。prototype: 每次请求都会创建一个新的实例。request: 每个 HTTP 请求创建一个实例仅适用于 Web 应用程序。session: 每个 HTTP 会话创建一个实例仅适用于 Web 应用程序。globalSession: 每个全局 HTTP 会话创建一个实例仅适用于 Web 应用程序。 6.1 Singleton 作用域 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义一个 Singleton 作用域的 Bean --bean idsingletonBean classcom.example.SingletonBean scopesingleton//beans在 Singleton 作用域下Spring 会创建一个共享实例所有对该 Bean 的引用都指向同一个对象。 6.2 Prototype 作用域 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义一个 Prototype 作用域的 Bean --bean idprototypeBean classcom.example.PrototypeBean scopeprototype//beans在 Prototype 作用域下每次请求该 Bean 时Spring 都会创建一个新的实例。 7. 生命周期回调 Spring 提供了多种方式来管理 Bean 的生命周期包括初始化和销毁回调方法。 7.1 init-method 和 destroy-method 通过 XML 配置文件可以指定 Bean 的初始化和销毁方法 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义 Bean指定初始化和销毁方法 --bean idlifecycleBean classcom.example.LifecycleBean init-methodinit destroy-methoddestroy//beansLifecycleBean.java package com.example;public class LifecycleBean {public void init() {System.out.println(Bean 初始化);}public void destroy() {System.out.println(Bean 销毁);} }7.2 实现 InitializingBean 和 DisposableBean 接口 除了通过 XML 配置还可以通过实现 InitializingBean 和 DisposableBean 接口来管理 Bean 的生命周期 package com.example;import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean;public class LifecycleBean implements InitializingBean, DisposableBean {Overridepublic void afterPropertiesSet() throws Exception {System.out.println(Bean 初始化);}Overridepublic void destroy() throws Exception {System.out.println(Bean 销毁);} }8. 集合类型的注入 Spring 支持对集合类型List、Set、Map、Properties的注入这使得管理复杂的数据结构变得简单。 8.1 List 注入 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义 ItemService 并注入 List --bean iditemService classcom.example.ItemServiceproperty nameitemslistvalueItem1/valuevalueItem2/valuevalueItem3/value/list/property/bean/beansItemService.java package com.example;import java.util.List;public class ItemService {private ListString items;public void setItems(ListString items) {this.items items;}public void displayItems() {for (String item : items) {System.out.println(item);}} }8.2 Map 注入 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义 DictionaryService 并注入 Map --bean iddictionaryService classcom.example.DictionaryServiceproperty namedictionarymapentry keykey1 valuevalue1/entry keykey2 valuevalue2/entry keykey3 valuevalue3//map/property/bean/beansDictionaryService.java package com.example;import java.util.Map;public class DictionaryService {private MapString, String dictionary;public void setDictionary(MapString, String dictionary) {this.dictionary dictionary;}public void displayDictionary() {for (Map.EntryString, String entry : dictionary.entrySet()) {System.out.println(entry.getKey() : entry.getValue());}} }8.3 Properties 注入 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 定义 AppConfig 并注入 Properties --bean idappConfig classcom.example.AppConfigproperty namepropertiespropsprop keyurlhttp://example.com/propprop keyusernameadmin/propprop keypasswordsecret/prop/props/property/bean/beansAppConfig.java package com.example;import java.util.Properties;public class AppConfig {private Properties properties;public void setProperties(Properties properties) {this.properties properties;}public void displayConfig() {System.out.println(URL: properties.getProperty(url));System.out.println(Username: properties.getProperty(username));System.out.println(Password: properties.getProperty(password));} }9. 外部化配置与属性占位符 Spring 提供了将配置外部化的功能可以从属性文件中加载属性并通过占位符的方式在 XML 配置中使用这些属性。这种方法对于环境配置、数据库连接信息等场景非常有用。 9.1 使用 PropertyPlaceholderConfigurer beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd!-- 加载外部属性文件 --bean classorg.springframework.beans.factory.config.PropertyPlaceholderConfigurerproperty namelocation valueclasspath:application.properties//bean!-- 定义数据库连接的 Bean使用属性占位符 --bean iddataSource classorg.apache.commons.dbcp.BasicDataSourceproperty namedriverClassName value${db.driver}/property nameurl value${db.url}/property nameusername value${db.username}/property namepassword value${db.password}//bean/beansapplication.properties db.drivercom.mysql.jdbc.Driver db.urljdbc:mysql://localhost:3306/mydb db.usernameroot db.passwordpassword9.2 使用 context:property-placeholder 通过 context:property-placeholder 标签简化属性配置 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd!-- 声明属性占位符 --context:property-placeholder locationclasspath:application.properties/!-- 定义数据库连接的 Bean --bean iddataSource classorg.apache.commons.dbcp.BasicDataSourceproperty namedriverClassName value${db.driver}/property nameurl value${db.url}/property nameusername value${db.username}/property namepassword value${db.password}//bean/beans10. 使用 Profiles 管理环境 Spring Profiles 是一种功能允许你根据运行时的环境来激活或切换不同的配置。它在开发、测试、生产环境中非常有用可以轻松切换配置。 10.1 配置 Profiles 定义两个不同的数据库配置文件分别用于开发和生产环境 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd!-- 声明属性占位符 --context:property-placeholder locationclasspath:application.properties/!-- 开发环境的配置 --beans profiledevbean iddataSource classorg.apache.commons.dbcp.BasicDataSourceproperty namedriverClassName value${db.dev.driver}/property nameurl value${db.dev.url}/property nameusername value${db.dev.username}/property namepassword value${db.dev.password}//bean/beans!-- 生产环境的配置 --beans profileprodbean iddataSource classorg.apache.commons.dbcp.BasicDataSourceproperty namedriverClassName value${db.prod.driver}/property nameurl value${db.prod.url}/property nameusername value${db.prod.username}/property namepassword value${db.prod.password}//bean/beans/beansapplication.properties db.dev.drivercom.mysql.jdbc.Driver db.dev.urljdbc:mysql://localhost:3306/devdb db.dev.usernamedevuser db.dev.passworddevpassworddb.prod.drivercom.mysql.jdbc.Driver db.prod.urljdbc:mysql://localhost:3306/proddb db.prod.usernameproduser db.prod.passwordprodpassword10.2 激活 Profile 可以通过设置 spring.profiles.active 环境变量来激活相应的 Profile java -Dspring.profiles.activedev -jar myapp.jar在上述命令中-Dspring.profiles.activedev 将激活开发环境配置。 11. 总结 Spring Framework 的 XML 配置文件提供了强大且灵活的功能来管理 Java 应用程序的组件和依赖关系。通过 XML 配置文件开发者可以 定义 Bean 及其依赖关系配置不同的作用域和生命周期回调注入集合类型和外部化配置使用 Profiles 来管理不同环境下的配置 虽然现代开发中注解和 Java 配置类变得越来越流行但 XML 配置依然在特定场景中提供了不可替代的便利性特别是在需要与非开发人员共享配置或遵循传统企业规范的情况下。 通过本篇文章的讲解和示例代码希望能够帮助你深入理解 Spring Framework XML 配置文件的使用方式以及如何通过这种方式有效地管理和构建应用程序。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/86328.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

网站目录管理模板手机网站js电话悬浮

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing 163.com】 嵌入式设备下面,有的时候也要对数据进行处理和保存。如果处理的数据不是很多,一般用json就可以。但是数据如果量比较大&…

黑彩网站建设旅游网站建设需求说明书

文章目录 整体设计processMail1.Checkpoint Tigger2.ProcessingTime Timer Trigger processInput兼容SourceStreamTask 整体设计 Mailbox线程模型通过引入阻塞队列配合一个Mailbox线程的方式,可以轻松修改StreamTask内部状态的修改。Checkpoint、ProcessingTime Ti…

怀化同城网站找工作网站

摘要:PDO查询中,2个绑定操作:参数绑定与列绑定;参数绑定:bindParm() 和 bindValue();bindParm(:占位符,变量,类型常量) 类型常量默认为字符串bindValue(:占位符,值或变量,类型常量) 如果直接传值,可省略类型…

政务网站集约化建设难点与建议徐州建设集团有限公司

问题:当我们要添加缓存时,如果我们用了PageHelper时,PageHelper只会对查询语句有效(使用到sql的查询),那么如果我们把查询到的数据都添加到缓存时,就会无法进行分页; 此时我们选择将…

徐州建站网站模板合肥 网站设计

n 座城市,从 0 到 n-1 编号,其间共有 n-1 条路线。因此,要想在两座不同城市之间旅行只有唯一一条路线可供选择(路线网形成一颗树)。去年,交通运输部决定重新规划路线,以改变交通拥堵的状况。 路…

网站建设锚点链接祭祖网站怎么做

自从最初的IEEE 802.3af 1型以太网供电(PoE)标准于2003年首次推出以来,该技术已经发展到包括2型(高达30瓦)、3型(高达60瓦)和4型(高达90瓦)。这意味着PoE电压现在支持从手…

如何创建一个个人网站wordpress 标题入库

接着上一篇不同场景下JVM调优手段及代码优化建议,接着来JVM调优可配置参数及配置时机和原则。以在JDK 8为例,JVM提供了一系列的可配置参数,这些参数可以帮助开发者和系统管理员针对不同的应用场景进行性能调优。以下是按维度划分的一些关键参数及其用途、…

国外服装设计网站seo优化报价公司

先贴代码,代码精简了。$invoker_function($argus);}}?>描述:程序是在ThinkPHP开发,目的是把Cache的get方法接收的参数转发到指定的方法上,最后一行:其中D方法是ThinkPHP自带的方法用的是单例模式。如果不加参数$ar…

公司网站申请书wordpress怎么建app

文章目录 前言一、笔试和性格测试二、面试2.1 技术面2.2 hr面前言 实习:笔试 + 1轮技术面 + 1轮主管面 一、笔试和性格测试 笔试题链接 1、网上可以找到很多以往的题目,需要注意的是数字芯片岗位会考到很多验证、中后端的知识,主打一个全栈,不要只看设计或者只看验证的东…

公司建网站多少钱qcjxkd百度收录什么网站吗

前言 一个针对深度学习应用优化的 GPU 加速库。它提供了高性能、高可靠性的加速算法,旨在加速深度神经网络模型的训练和推理过程。 cuDNN 提供了一系列优化的基本算法和函数,包括卷积、池化、规范化、激活函数等,以及针对深度学习任务的高级功…

网站建设项目说明书松岗做网站

前言:大数据相关的技术名词特别多,这些技术栈之间的关系是什么,对初学者来说很难找到抓手。我一开始从后端转大数据的时候有点懵逼,整体接触了一遍之后才把大数据技术栈给弄明白了。 一、大数据技术栈 做大数据开发,无…

网站设计中的js网站流量刷

原文1:https://cloud.tencent.com/developer/article/1151834 原文2:https://www.cnblogs.com/zhaohuhu/p/9140673.html转载于:https://www.cnblogs.com/olivertian/p/10982658.html

规划管理部门的网站建设保定建网站需要多少钱

2018-03-05 14:06:40 问题描述:给出一个数据流,这个数据流的长度很大或者未知。并且对该数据流中数据只能访问一次。请写出一个随机选择算法,使得数据流中所有数据被选中的概率相等。 问题求解:如果是长度已知或者有限的问题&…

麦壳云网站建设推广思路及执行方案

了解ISO模型:构建通信的蓝图 为了促进网络应用的普及,国际标准化组织(ISO)引入了开放式系统互联(Open System Interconnect,OSI)模型。这个模型包括了七个层次,从底层的物理连接到顶…

哈尔滨网站域名部门中学网站源码

技术方法 数据映射的技术方法主要包括以下几种: 手工法: 手工法涉及开发人员手动编码数据源和目标架构之间的链接。这通常使用如XSLT这样的计算机语言来编写代码,将XML文档翻译成各种格式。然而,随着数据系统的扩展和复杂化&…

东莞高端品牌网站建设价格自己做网站需要做啥

Android.mk是Android提供的一个makefile文件,可以将源文件分组为模块。用来引用的头文件目录、需要编译的*.c/.cpp文件、jni源文件、指定编译生成.so共享库文件或者*.a静态库文件,可以定义一个或多个模块,也可以多个模块中使用同一个源文件&a…

遵义网站中山h5网站建设

以下内容为自己的理解,如有错误请指出。 连通 连通和电路中的导通一样。 注意:连通可以是直接连通,也可以经过其他节点后再连通。只要能导通就叫连通。 连通图 任意两个节点间都有路径的图,叫做连通图。 在无向图中&#xff…

宣传网站建设背景谷歌推广开户多少费用

RSI指数的计算非常简单,就是使用一段时间内的平均上涨除以平均上涨加平均下跌(取正值)。也就意味着RSI指数的取值是[0,100]之间,其中0表示周期内没有上涨的,100表示周期内没有下跌的。RSI的直观意义是它表示了一段周期…

做外贸怎样免费登录外国网站中国建筑网最新招聘

目录 044 递归 e04 冒泡排序2 044 递归 e05 插入排序1 044 递归 e05 插入排序2 045 多路递归 斐波那契 046 多路递归 斐波那契 时间复杂度 047 多路递归 斐波那契 兔子问题 048 多路递归 斐波那契 青蛙跳台阶 049 递归 优化 记忆法 050 递归 爆栈问题 051 递归 尾调用…

德州极速网站建设百家号站酷海洛设计网站官网

然后来看字典高级,首先 打印某个元素 然后打印的时候注意,如果直接打印的值,在字典中没有就报错 这里要注意不能用点访问