1.servlet:
request.setAttribute("objectname",objectvalue);
getServletContext().getRequestDispatcher(a.jsp).forward(request, response);
a.jsp
object=(objectname)request.getAttribute("objectname");
2.servlet:
request.setAttribute("objectname",object);
getServletContext().getRequestDispatcher(a.jsp).forward(request, response);
a.jsp:
aaa =(objectype)request.getAttribute("objectname");
getAttributet取值的时候强制类型转换成String[]类型的,前面再定义一个String[]的变量接收就行了
String[] str = (String[])request.getAttribute("abc");
jstl:
古老jsp内嵌java代码:
<%
String[] list= (String[])request.getAttribute("arrayName");
if(list!=null){
for(int i=0;i
%>
<%
}
%>