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

如何分析网站关键词/广东网站营销seo费用

如何分析网站关键词,广东网站营销seo费用,虚拟主机建站,c 网站开发案例详解百度云1.导入jar包 四个核心(core,beans,context,expression)一个依赖(Commons-logging) 我使用的Spring版本是3.2.0 导入的jar包如下图 2.目标类 提供UserService接口和实现类获得UserService实现类的实例 在之前开发中&#xf…

1.导入jar包

  • 四个核心(core,beans,context,expression)+一个依赖(Commons-logging)
    我使用的Spring版本是3.2.0 导入的jar包如下图
    这里写图片描述

2.目标类

  • 提供UserService接口和实现类
  • 获得UserService实现类的实例
    在之前开发中,我们直接new对象即可
    学习Spring之后将由Spring创建对象实例即IOC(控制反转) ,实例对象时,从Spring工厂中获得,需要将实现的类的全限定(包名+类名)名配置到xml文件中
    UsersService接口
package com.scx.test01;public interface UsersService {public void show();
}

UsersService实现类

package com.scx.test01;public class UsersServiceImpl implements UsersService {@Overridepublic void show() {System.out.println("UsersServiceImpl被new了");}
}

3.配置文件

  • 位置:任意 ,开发中一般在classpath下(src)
  • 名称:任意,开发中常用applicationContext.xml
  • 内容:添加scheme约束
    约束文件位置:spring-framework-3.2.0.RELEASE\docs\spring-framework-reference\html\ xsd-config.html
<?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 definitions here --><!-- 配置service <bean>配置需要创建的对象id:用于之后从spring容器中获得实例时使用的class:需要创建实例的全限定类名--><bean id="UsersServiceId" class="com.scx.test01.UsersServiceImpl"></bean>
</beans>

4.Junit测试

package com.scx.test;import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.scx.test01.UsersService;
import com.scx.test01.UsersServiceImpl;public class Test {@org.junit.Testpublic void test01() {/** 之前开发 自己new对象*/UsersService usersService1=new UsersServiceImpl();usersService1.show();/** Spring开发 不需要自己new 都从Spring工厂中获得*/String xmlPath = "com/scx/test01/applicationContext.xml";//获得容器ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);//获得内容UsersService usersService2 = (UsersService) applicationContext.getBean("UsersServiceId");usersService2.show();}
}

运行结果:
这里写图片描述

从运行结果可以看出,第一次的结果由自己new对象实例化,而第二次的结果输出Spring相关信息后也输出了运行结果。利用Spring的IOC(控制反转)成功创建了对象。

http://www.jmfq.cn/news/5196223.html

相关文章:

  • 中国做b2b外贸的网站有哪些/潍坊做网站哪家好
  • 哪个网站做任务能赚钱/权重查询
  • 织梦怎么制作网站/百度推广哪家做的最好
  • 金昌北京网站建设/手游推广渠道平台
  • 企业网站作用/产品市场调研怎么做
  • 昌邑做网站的公司/网站建设培训机构
  • 网站富文本的内容怎么做/怎样宣传网站
  • wordpress php 结构/seovip培训
  • 简述企业网站建设的目的有哪些/长沙网站关键词排名推广公司
  • 清仓在什么网站做/百度网站排名优化价格
  • 互联网行业的开发网站/百度关键词挖掘
  • 河北邯郸什么时候解封/网站优化方案模板
  • 动态网站开发视频教程/西安百度百科
  • 广州响应网站建设/域名在线查询
  • 河南网站建设哪里好/在线推广
  • 门户类网站模板/百度一下搜索一下
  • 网上书店网站建设实训报告总结/百度推广引流
  • 门户网站定义/无安全警告的浏览器
  • vs2017 做c 网站/seo入门教程视频
  • 如何开发wap网站/高清视频网络服务器
  • 做网站多大/上海广告推广
  • 个人+网站可以做导航吗/网络营销swot分析
  • 湖北外贸网站建设费用/西点培训学校
  • repress wordpress/北京seo顾问推推蛙
  • 金泉网做网站要找谁/百度热线
  • 香港公司做网站国外销售/网络推广深圳有效渠道
  • 把网站提交给百度/搜索引擎优化关键词
  • 山西网站开发建设/我要发布信息
  • 用什么软件快速做网站/灰色推广引流联系方式
  • 公司要网站建设/快优吧seo优化