<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
My JSP 'test.jsp' starting page <%
//假设这是List
List
list = new ArrayList();
//加入数据
String[] s1= new String[2];
s1[0] = "s1[0]";
s1[1] = "s1[1]";
String[] s2= new String[2];
s2[0] = "s2[0]";
s2[1] = "s2[1]";
list.add(s1);
list.add(s2);
//以上是模拟数据.
for(String[] s:list){
System.out.println("--o-"+s[0]);
System.out.println("--1-"+s[0]);
}
System.out.println("方法二:");
//或者:
for(int i=0;i String[] s = list.get(i);
System.out.println("--o-"+s[0]);
System.out.println("--1-"+s[0]);
}
%>