在index.jsp页面request不能调用getServletContext()方法,代码没有错误啊,仔细对照过了,新手求指导啊!!!
<%
ArrayList<entity.User> userList = (ArrayList<entity.User>)request.getServletContext().getAttribute("userList");
out.println(userList.size());
if(userList!=null){
for(int i = 0 ; i < userList.size() ; i++){
entity.User user = userList.get(i);
%>
IP:<%=user.getIpString() %>,FirstTime:<%=user.getFirstTimeString() %>,SessionId:<%=user.getSessionIdString() %> <br/>
<%}} %>