${y} ">

jsp遍历、循环

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

1.

<%

Test test = new Test();

List listTest = test.getlist();//得到List对象()

request.setAttribute("testList", listTest );//把List设置到Request对象中

%>

2.

${i}

3.

<%

Date d=new Date();

d.getTime();

SimpleDateFormat sdf=new SimpleDateFormat("yyyy");

String year=sdf.format(d);

List yearList=new ArrayList();

for(int i=0;i<8;i++){

int y=Integer.parseInt(year);

yearList.add(y-i+"");

}

%>

  • ${y}
  • 友情链接:
    Copyright © 2022 86年世界杯_世界杯预选赛阿根廷 - fjyfzz.com All Rights Reserved.