java, session.setAttribute(userIDKey, userID);/////此处setAttribute()什么意思啊?三个问题
IntegervisitCount=newInteger(0);StringvisitCountKey=newString("visitCount");Stringuse...
Integer visitCount = new Integer(0);
String visitCountKey = new String("visitCount");
String userIDKey = new String("userID");
String userID = new String("ABCD");
// 检查网页上是否有新的访问者
if (session.isNew()){
title = "欢迎来到我的网站";
session.setAttribute(userIDKey, userID);//此处setAttribute()什么意思啊?
} else {
visitCount = (Integer)session.getAttribute(visitCountKey);//此处getAttribute()什么意思啊? visitCount = visitCount + 1;
userID = (String)session.getAttribute(userIDKey);//这里 userID 和userIDKey什么意思啊?
}
session.setAttribute(visitCountKey, visitCount); 展开
String visitCountKey = new String("visitCount");
String userIDKey = new String("userID");
String userID = new String("ABCD");
// 检查网页上是否有新的访问者
if (session.isNew()){
title = "欢迎来到我的网站";
session.setAttribute(userIDKey, userID);//此处setAttribute()什么意思啊?
} else {
visitCount = (Integer)session.getAttribute(visitCountKey);//此处getAttribute()什么意思啊? visitCount = visitCount + 1;
userID = (String)session.getAttribute(userIDKey);//这里 userID 和userIDKey什么意思啊?
}
session.setAttribute(visitCountKey, visitCount); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询