有人說myeclipse只有tomcat6.0 那可能是myeclipse自帶安裝的服務器。如果你自己下的別的版本在自己電腦,請在myeclipse里面自己再配一個本地的tomcat。而且多個服務器不要同時打開,因為端口可能會發生沖突,導致后面的服務器無法打開。
2018-04-09
新來的朋友注意看了,這段代碼,有一點小問題
if (isUseCookies != null && isUseCookies.length > 0);
這段代碼已經重復判斷了,實際上只需一個(isUseCookies != null)就可以了。
1、如果isUseCookies為空,整個表達式為假,那么后面的isUseCookies.lenth > 0就不會執行了;
2、如果isUseCookies不為空,也就是說isUseCookies.length > 0了,后面的表達式造成的重復判斷。
if (isUseCookies != null && isUseCookies.length > 0);
這段代碼已經重復判斷了,實際上只需一個(isUseCookies != null)就可以了。
1、如果isUseCookies為空,整個表達式為假,那么后面的isUseCookies.lenth > 0就不會執行了;
2、如果isUseCookies不為空,也就是說isUseCookies.length > 0了,后面的表達式造成的重復判斷。
2018-04-07
常用jsp對象out request response session applocation
jsp九大內置對象其他對象 Page pageContext exception config
jsp九大內置對象其他對象 Page pageContext exception config
2018-04-05
<%
int number=-1;
// 說明用戶第一次訪問頁面,計數器對象還未創建
if(application.getAttribute("counter")==null)
{
application.setAttribute("counter", 0); }
number = Integer.parseInt(application.getAttribute("counter").toString());
number++;
application.setAttribute("counter", number);
%>
老師源碼里的 記錄訪問此頁面的用戶數量
int number=-1;
// 說明用戶第一次訪問頁面,計數器對象還未創建
if(application.getAttribute("counter")==null)
{
application.setAttribute("counter", 0); }
number = Integer.parseInt(application.getAttribute("counter").toString());
number++;
application.setAttribute("counter", number);
%>
老師源碼里的 記錄訪問此頁面的用戶數量
2018-04-03