<%
Student student1=new Student(1,"张三","123");
Student student2=new Student(2,"张1","123");
Student student3=new Student(3,"张2","123");
Student student4=new Student(4,"张4","123");
pageContext.setAttribute("student", student1);
request.setAttribute("student",student2);
session.setAttribute("student", student3);
application.setAttribute("student", student4);
%>
${student}<br>
${pageScope.student.name}<br>
${requestScope.student }<br>
${sessionScope.student.id }<br>
${applicationScope.student.password }<br>


原文:http://www.cnblogs.com/Actexpler-S/p/7348306.html