springframework.beans.factory.BeanFactory" pageEncoding="UTF-8"%>
http://java.sun.com/ jsp/ jstl/core" prefix="c" %>
springframework.core.io.Resource"%>
springframework.core.io.ClassPathResource"%>
springframework.beans.factory. xml.XmlBeanFactory"%>
springframework.core.io.FileSystemResource"%>
nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
标签测试
//测试数组
List li=new ArrayList();
li.add("123");
li.add("234");
li.add("456");
request.setAttribute("li",li);
//测试map
HashMap map=new HashMap();
map.put("1","111");
map.put("2","222");
map.put("3","333");
request.setAttribute("map",map);
//测试bean
ClassPathResource resource = new ClassPathResource("../applicationContext. xml");
BeanFactory factory = new XmlBeanFactory(resource);
NewObjDAO newobjdao=(NewObjDAO)factory.getBean("NewObjDAO");
List nlist=newobjdao.getList();
request.setAttribute("nlist",nlist);
//测试带分隔符的字符串
String movie="好想有个家,爱你一万年,今天,冰雨";
request.setAttribute("movie",movie);
%>
<!-- 绑定ArrayList -->
${li}
<!-- 绑定map -->
${ li.key} ${ li.value}
<!-- 绑定beanlist -->
${ li.id} ${ li.name}
<!-- 绑定String -->
${li}
<!-- forTokens绑定String,并指定分隔符 -->
delims=",">
${li}
<!-- if与varStatus的结合,first代表是否是第一个迭代元素,还有last,count,index等,其中count代表当前这次迭代从 1 开始的迭代计数 -->
${li.id} ${li.name} ${li.addtime }
${li.id} ${li.name}
<!--只有第一个元素才显示"添加日期" -->
http://java.sun.com/ jsp/ jstl/core" prefix="c" %>
springframework.core.io.Resource"%>
springframework.core.io.ClassPathResource"%>
springframework.beans.factory. xml.XmlBeanFactory"%>
springframework.core.io.FileSystemResource"%>
nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
标签测试
//测试数组
List li=new ArrayList();
li.add("123");
li.add("234");
li.add("456");
request.setAttribute("li",li);
//测试map
HashMap map=new HashMap();
map.put("1","111");
map.put("2","222");
map.put("3","333");
request.setAttribute("map",map);
//测试bean
ClassPathResource resource = new ClassPathResource("../applicationContext. xml");
BeanFactory factory = new XmlBeanFactory(resource);
NewObjDAO newobjdao=(NewObjDAO)factory.getBean("NewObjDAO");
List nlist=newobjdao.getList();
request.setAttribute("nlist",nlist);
//测试带分隔符的字符串
String movie="好想有个家,爱你一万年,今天,冰雨";
request.setAttribute("movie",movie);
%>
<!-- 绑定ArrayList -->
${li}
<!-- 绑定map -->
${ li.key} ${ li.value}
<!-- 绑定beanlist -->
${ li.id} ${ li.name}
<!-- 绑定String -->
${li}
<!-- forTokens绑定String,并指定分隔符 -->
delims=",">
${li}
<!-- if与varStatus的结合,first代表是否是第一个迭代元素,还有last,count,index等,其中count代表当前这次迭代从 1 开始的迭代计数 -->
${li.id} ${li.name} ${li.addtime }
${li.id} ${li.name}
<!--只有第一个元素才显示"添加日期" -->
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11084024/viewspace-580324/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11084024/viewspace-580324/