计数器小问题?请看看

tr100 2002-04-26 08:37:18
<%--Tomato-jsp-study--%>
<%@ page language="java" contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>网页计数器</title>
</head>
<body>
<%if(application.getAttribute("counter")==null)
application.setAttribute("count","1");
else
application.setAttribute("count",Integer.toString(Integer.valueOf(
application.getAttribute("count").toString()).intValue()+1));%>你是第<%=application.getAttribute("count")%>位访问者
</body>
</html>
//为什么count没有反映呢?
...全文
68 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tr100 2002-04-26
  • 打赏
  • 举报
回复
我搞,不好意思……这种问题,也会出……
55555555555555555555555
liangxuan1979 2002-04-26
  • 打赏
  • 举报
回复
对,tin_dra(鹈觥) 老兄说的对,你拼写错误了!
tin_dra 2002-04-26
  • 打赏
  • 举报
回复

if(application.getAttribute("counter")==null
改成
if(application.getAttribute("count")==null

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧