首页 试题广场 > 试题详情
单选题

【C014065】在 IE 窗口访问 JSP 页面,其代码如下,然后连接刷新四次页面,输出的结果是 X,紧接着重新启动一个新的 IE 窗口运行该 JSP 代码,连续刷新两次,输出的结果是 Y,请问 X 和Y 的值分别是( )。
<%@ page contentType="text/html;charset=GBK"%>
<html>
<%
Integer cnt=(Integer)application.getAttribute("hitCount");
if(cnt == null){
cnt = new Integer(1);
}else{
cnt = new Integer(cnt.intV alue() + 1);
}
application.setAttribute("hitCount",cnt);
%>
<%=cnt%>
</html>

  • A.5,8
  • B.5,3
  • C.1,2
  • D.1,1
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 14个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部