1.直接上類代碼:import javax.servlet.http.*;public class listenTest implements HttpSessionListener{public static int count; --此處定義了靜態變量public listenTest() {super();// TODO Auto-generated cons;tructor stubcount=0;}....2.在網頁中引用的格式:<%=listenTest.count %> 3.在運行網頁進行測試時的錯誤:An error occurred at line: 113 in the jsp file: /index.jsplistenTest cannot be resolved to a variable110: 111: <%/**涓嬮潰涓鴻〃鍗曞強鍙傛暟銆佽煩杞祴璇?/ %>112: <% out.print("--------------------------琛ㄥ崟嫻嬭瘯 -----------------------------------------"); %>113: <%=listenTest.count %> 114: 115: 116: <form name="form1" action="x.ao" method="post"><br>
jsp類的靜態屬性如何顯示到網頁中 ?
慕的地6264312
2019-02-14 15:11:29