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

网站推广适合哪种公司做软文营销的五大注意事项

网站推广适合哪种公司做,软文营销的五大注意事项,广州网站设计哪家公司好,长椿街网站建设xml注入集合属性 1.注入数组类型属性 2.注入List集合类型属性 3.注入Map集合类型属性 #xff08;1#xff09;创建类#xff0c;定义数组#xff0c;list#xff0c;map#xff0c;set类型属性#xff0c;生成对应set方法 package com.atguigu.collectiontype;imp…xml注入集合属性 1.注入数组类型属性 2.注入List集合类型属性 3.注入Map集合类型属性 1创建类定义数组listmapset类型属性生成对应set方法 package com.atguigu.collectiontype;import java.util.List; import java.util.Map; import java.util.Set;public class Stu {//1.数组类型属性private String[] courses;//2.List集合类型属性private ListString list;//3.map集合类型属性private MapString,String maps;//4.set集合类型属性private SetString sets;public void setSets(SetString sets) {this.sets sets;}public void setList(ListString list) {this.list list;}public void setMaps(MapString, String maps) {this.maps maps;}public void setCourses(String[] courses){this.courses courses;}public void test(){System.out.println(Arrays.toString(courses));System.out.println(list);System.out.println(maps);System.out.println(sets);}} 2在spring配置文件中进行配置 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd!--1.集合类型属性注入--bean id stu class com.atguigu.collectiontype.Stu!--数组类型属性注入--property namecoursesarrayvaluejava课程/valuevalue数据库课程/value/array/property!--list类型属性注入--property namelistlistvalue张三/valuevalue小三/value/list/property!--map类型属性注入--property namemapsmapentry key JAVA valuejava/entryentry key PHP valuephp/entry/map/property!--set类型属性注入--property namesetssetvalueMySQL/valuevalueRedis/value/set/property/bean/beanspackage com.atguigu.test;import com.atguigu.collectiontype.Stu; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;public class testCollection {Testpublic void testCollection(){ApplicationContext context new ClassPathXmlApplicationContext(bean5.xml);Stu stu context.getBean(stu, Stu.class);stu.test();} }在集合里面设置对象类型值 package com.atguigu.collectiontype;public class Course {private String cname;//课程名称public void setCname(String cname) {this.cname cname;}Overridepublic String toString() {return Course{ cname cname \ };} } package com.atguigu.collectiontype;import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set;public class Stu {//1.数组类型属性private String[] courses;//2.List集合类型属性private ListString list;//3.map集合类型属性private MapString,String maps;//4.set集合类型属性private SetString sets;//学生所学多门课程private ListCourse courseList;public void setCourseList(ListCourse courseList) {this.courseList courseList;}public void setSets(SetString sets) {this.sets sets;}public void setList(ListString list) {this.list list;}public void setMaps(MapString, String maps) {this.maps maps;}public void setCourses(String[] courses){this.courses courses;}public void test(){System.out.println(Arrays.toString(courses));System.out.println(list);System.out.println(maps);System.out.println(sets);System.out.println(courseList);}} ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlns:utilhttp://www.springframework.org/schema/utilxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd!--1.集合类型属性注入--bean id stu class com.atguigu.collectiontype.Stu!--数组类型属性注入--property namecoursesarrayvaluejava课程/valuevalue数据库课程/value/array/property!--list类型属性注入--property namelistlistvalue张三/valuevalue小三/value/list/property!--map类型属性注入--property namemapsmapentry key JAVA valuejava/entryentry key PHP valuephp/entry/map/property!--set类型属性注入--property namesetssetvalueMySQL/valuevalueRedis/value/set/property!--注入list集合类型值是对象--property namecourseListlistref beancourse1/refref bean course2/ref/list/property/bean!--创建多个course对象--bean id course1 class com.atguigu.collectiontype.Courseproperty namecname valueSpring5框架/property/beanbean id course2 class com.atguigu.collectiontype.Courseproperty namecname valueMySql5框架/property/bean/beans测试 package com.atguigu.test; import com.atguigu.collectiontype.Stu; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;public class testCollection {Testpublic void testCollection(){ApplicationContext context new ClassPathXmlApplicationContext(bean5.xml);Stu stu context.getBean(stu, Stu.class);stu.test();} }把集合注入部分提取出来 1在spring配置文件中引入名称空间util ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:utilhttp://www.springframework.org/schema/utilxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd/beans2使用util标签完成list集合注入提取 package com.atguigu.spring.collectiontype;import java.util.List;public class Book {private ListString list;public void setList(ListString list){this.list list;}public void test(){System.out.println(list);} } ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:utilhttp://www.springframework.org/schema/utilxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd!--1.提取list集合类型属性注入--util:list id bookListvalue易筋经/valuevalue九阴真经/valuevalue九阳神功/value/util:list!--2.提取list集合类型属性注入使用--bean id book class com.atguigu.spring.collectiontype.Bookproperty namelist ref bookList/property/bean/beans测试 package com.atguigu.spring.test;import com.atguigu.spring.collectiontype.Book; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;public class testBook {Testpublic void testCollection(){ApplicationContext context new ClassPathXmlApplicationContext(bean1.xml);Book book context.getBean(book, Book.class);book.test();}}
http://www.zqtcl.cn/news/742481/

相关文章:

  • 沈阳做网站推广唐山网站怎么做seo
  • 网站备案说主体已注销刷关键词指数
  • 学做网站教学百度网盘动软代码生成器 做网站
  • 长辛店网站建设手机评测网站
  • 网站建设公司选哪个好软件开发
  • 隐形眼镜网站开发的经济效益莘县网站开发
  • 开创集团网站建设如何在学校网站上做链接
  • 上海优秀网站设计百度投诉中心人工电话号码
  • 卖建材的网站有哪些跨境电商工具类产品的网站
  • 做毕业网站的周记网站开发项目书
  • 门户网站价格仿站工具下载后咋做网站
  • 国外优秀ui设计网站常州网站建设电话
  • 大连手机网站建设做外贸无网站如何做
  • 做旅游门票网站需要什么材料人工智能培训机构哪个好
  • 免费的网站程序个人网站可以做论坛么
  • ps中网站页面做多大的wordpress cdn 阿里
  • 深圳整站创意设计方法有哪些
  • 浙江做网站多少钱江门市网站开发
  • 保定建站价格dw软件免费安装
  • 在建设部网站上的举报凡科网怎么建网站
  • wordpress做小说网站工作期间员工花钱做的网站
  • 婚介网站方案小说网站架构
  • 英文在线购物网站建设湖北建设厅举报网站
  • 漯河网络推广哪家好宁波网站seo公司
  • 网站设计ppt案例做物流用哪个网站好
  • 做网站官网需多少钱天元建设集团有限公司财务分析
  • 一般网站建设用什么语言网络规划设计师历年考点
  • 做网站卖菜刀需要什么手续江苏网站优化
  • 花生壳内网穿透网站如何做seo优化鞍山58同城网
  • 怎么为一个网站做外链跨境电商app