アクセス数を統計する簡単な方法
1439 ワード
public class Count
{
private int count;
public int getCount()
{
return ++count;
}
public void setCount(int count)
{
this.count = count;
}
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title> </title>
</head>
<body>
<jsp:useBean id="count" class="com.chinasoft.zy.Count" scope="session"></jsp:useBean>
<jsp:useBean id="count2" class="com.chinasoft.zy.Count" scope="application"></jsp:useBean>
:<jsp:getProperty name="count" property="count"/><br>
:<jsp:getProperty name="count2" property="count"/>
</body>
</html>