实用网站开发做seo需要投入的成本
实用网站开发,做seo需要投入的成本,宣威做网站推广的公司,网站流量统计 设计注入方式 set方法注入 构造函数注入 p名称空间注入 spel注入(#表示理解为引用) 练习代码#xff1a; !-- 第二天 set注入 index:索引 ref:引用对象 type:参数类型--bean nameperson classcom.spring.bean.Personconstructor-a…注入方式 set方法注入 构造函数注入 p名称空间注入 spel注入(#表示理解为引用) 练习代码 !-- 第二天 set注入 index:索引 ref:引用对象 type:参数类型--bean nameperson classcom.spring.bean.Personconstructor-arg namename value12 index0 typejava.lang.Integer/constructor-argconstructor-arg namecar refcar index1 /constructor-arg/beanbean namecar classcom.spring.bean.Carproperty namename value兰博基尼/propertyproperty namecolor value绿色/property/bean!-- p命名空间 --bean nameperson1 classcom.spring.bean.Person p:nameAlan2 p:age18 p:car-refcar/bean!-- spel springEL表达式注入 --bean nameperson2 classcom.spring.bean.Personproperty namename value#{person1.name}/propertyproperty nameage value#{person1.age}/propertyproperty namecar refcar/property/bean
复杂类型注入 数组 List Map Properties 练习代码 applicationContext.xml !-- 复杂类型注入 --bean namecolleactionsBean classcom.spring.bean.ColleactionsBean!-- 集合中只有一个值 --!-- property namearraylist valuehello/property --!-- 集合中有多个值 --property namearrayarrayvalue1/valuevalue2/valuevalue3/value/array/propertyproperty namelistlistvaluealanList1/valuevaluealanList2/valuevaluealanList3/value/list/propertyproperty namemapmapentry keyalanMap value12/entryentry keyalan1Map value13/entryentry keyalan2Map value14/entry/map/propertyproperty namepropertiespropsprop keyprop1p1/propprop keyprop2p2/propprop keyprop3p3/prop/props/property/bean
ColleactionsBean.java
package com.spring.bean;import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Properties;public class ColleactionsBean {private int[] array;private List list;private Map map;private Properties properties;public int[] getArray() {return array;}public void setArray(int[] array) {this.array array;}public List getList() {return list;}public void setList(List list) {this.list list;}public Map getMap() {return map;}Overridepublic String toString() {return ColleactionsBean [array Arrays.toString(array) , list list , map map , properties properties ];}public void setMap(Map map) {this.map map;}public Properties getProperties() {return properties;}public void setProperties(Properties properties) {this.properties properties;}}TestDemo.java
package com.test;import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;import com.spring.bean.User;public class TestDemo {private ClassPathXmlApplicationContext context;Testpublic void testDemo() throws InterruptedException{context new ClassPathXmlApplicationContext(applicationContext.xml);/*scopeprototype的javaBean在创建容器时候不会被创建*/User bean (User)context.getBean(user);//User bean1 (User) context.getBean(user);//System.out.println(beanbean1);bean.setName(DreamZuora);bean.setAge(18);System.out.println(bean);/*单例对象可以销毁多例对象不会被销毁*/context.close();}}
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/86962.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!