欢迎来到天天文库
浏览记录
ID:36317208
大小:2.72 MB
页数:36页
时间:2019-05-09
《tapestry集成aja》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Tapestry集成Ajax作者:李金峰修改web.xml新建一个动态Web工程“AjaxAndTypestry”,修改web.xml成如下:Spring2、am-name>tapestry.app-packagecom.licontextConfigLocation/WEB-INF/spring-service.xmlapporg.apache.t
2、am-name>tapestry.app-packagecom.li
3、apestry5.spring.TapestrySpringFilterapp/*添加spring-service.xml和jar文件在WEB-INF下添加spring-service.xml4、amework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsd">在lib下添加jar包:建实体类Entry.java在com.li.pojo下建立Entry.javapublicclassEntry{pr5、ivateStringname;privateStringaddress;publicEntry(){}publicEntry(Stringname,Stringaddress){this.name=name;this.address=address;}publicStringgetName(){returnname;}......Address.java构造函数中添加通讯录在com.li.pojo中,建立类Address.javapublicclassAddress{publicListentries;/***添加通讯录。*/publicAddre6、ss(){entries=newArrayList();entries.add(newEntry("莫言","山东.高密"));entries.add(newEntry("李逵","山东.梁山"));entries.add(newEntry("李清照","山东.济南"));entries.add(newEntry("李金峰","华夏.蓉城"));entries.add(newEntry("张学友","中国.香港"));entries.add(newEntry("张飞","河北.涿郡"));}......}Address.selectNamesByKe7、y(key)selectNamesByKey返回相同开头的人名列表publicclassAddress{....../***返回形同开头的名字列表*@paramkey人名开头*@return人名列表*/publicListselectNamesByKey(Stringkey){Listmatches=newArrayList();for(Iteratoriter=entries.iterator();iter.hasNext();){Entryentry=iter.next();if(entry.get8、Name(
4、amework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsd">在lib下添加jar包:建实体类Entry.java在com.li.pojo下建立Entry.javapublicclassEntry{pr
5、ivateStringname;privateStringaddress;publicEntry(){}publicEntry(Stringname,Stringaddress){this.name=name;this.address=address;}publicStringgetName(){returnname;}......Address.java构造函数中添加通讯录在com.li.pojo中,建立类Address.javapublicclassAddress{publicListentries;/***添加通讯录。*/publicAddre
6、ss(){entries=newArrayList();entries.add(newEntry("莫言","山东.高密"));entries.add(newEntry("李逵","山东.梁山"));entries.add(newEntry("李清照","山东.济南"));entries.add(newEntry("李金峰","华夏.蓉城"));entries.add(newEntry("张学友","中国.香港"));entries.add(newEntry("张飞","河北.涿郡"));}......}Address.selectNamesByKe
7、y(key)selectNamesByKey返回相同开头的人名列表publicclassAddress{....../***返回形同开头的名字列表*@paramkey人名开头*@return人名列表*/publicListselectNamesByKey(Stringkey){Listmatches=newArrayList();for(Iteratoriter=entries.iterator();iter.hasNext();){Entryentry=iter.next();if(entry.get
8、Name(
此文档下载收益归作者所有