Action statistics visits

2010-06-27  来源:本站原创  分类:Java  人气:157 

Description: Video from Chi Chuan

package cn.itcast;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class CountAction extends Action (

private int count = 0;
@ Override
/ / Safety action statistics visits
public ActionForward execute (ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception (
/ / TODO Auto-generated method stub
synchronized (new Integer (count)) (
count + +;
)

PrintWriter pw = response.getWriter ();
pw.print ("action to access the number" + count);
return null;
)

)

-------------------------------------------

package cn.itcast;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class CountAction extends Action (

private Integer count = 0;
@ Override
/ / Safety action statistics visits
public ActionForward execute (ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception (
/ / TODO Auto-generated method stub
synchronized (count) (
count + +;
)

PrintWriter pw = response.getWriter ();
pw.print ("action to access the number" + count);
return null;
)

)

相关文章
  • Action statistics visits 2010-06-27

    Description: Video from Chi Chuan package cn.itcast; import java.io.PrintWriter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.Acti

  • java web site traffic statistics 2009-05-27

    Master Come! ! java Statistics Web site traffic and online problems, have made known to direct a simple example I would like to thank La. ! Reward points: 30 - Resolution time :2009-9-14 09:16 My e-mail [email protected], Thanks again! ! ! Asked by: h

  • jsp application Aplication traffic statistics 2010-05-03

    1. application produced an overview of the server starts after the object of this application, when the customers visited the site to navigate between different pages, this application objects are the same, until the server is down. But the differenc

  • Website operating data analysis 2010-05-28

    Web site operators for the process of data analysis, have become each site plan and Web site operations personnel, the daily homework necessary, these data indicators can help us to accurately grasp the actual user trends and site conditions. In fact

  • 2000个软件开发领域的高频特殊词及精选例句(二) 2015-03-19

    superword是一个Java实现的英文单词分析软件,主要研究英语单词音近形似转化规律.前缀后缀规律.词之间的相似性规律等等. 276.单词 tokenizer 的匹配文本: Analysis is done by the analyzer, which is built of tokenizer and zero or more filters, and can also have zero or more character mappers. Mastering ElasticSearch

  • struts2 those things (ognl) 2009-06-23

    1, domain objects need to pass parameters into account will help you construct an object and this object must be whether the argument constructor or you need your new 2. Can call stack of the common property of the value of the method and the general

  • Linux kernel traffic control (17) 2011-01-10

    Copyleft this document owned by yfydz all, the use of GPL, free to copy, reprint, reproduced keep the documents for completeness, for any commercial purposes is strictly prohibited. msn: [email protected] Source: http://yfydz.cublog.cn 7.6 tcf_pr

  • . Net number of total visits and on-line statistics 2010-10-25

    Start by adding a global file Global.asa void Application_Start(object sender, EventArgs e) { // When the application starts to run code Application["count"]=0; } void Session_Start(object sender, EventArgs e) { // In a new session code that run

  • How the statistics of visits to your site and get JAVA visitor IP 2011-01-12

    package com.eaie.system; import java.io.FileOutputStream; import java.io.InputStream; import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; import java.util.Enumeration; import java.util.Set; import javax.servlet.Req

  • Lucene in Action (Simplified Chinese) 2010-03-29

    A total of 10 part of the first part of the Lucene core 1. Contact Lucene 2. Index 3. To add a search procedure 4. Analysis of 5. High-pole search technology 6. Extended Search application of the second part of the Lucene 7. Analysis of commonly used

  • Online for population statistics 2010-03-29

    In many web projects will need statistics on the number line. A front-end time to do such a module, specifically achieve the following: (1) web.xml session time-out definition is required: <! - Session timeout defined in minutes - " <session-co

  • Servlet listener achieved using a simple Web site traffic and statistics on the number line 2009-06-20

    There are three kinds of Servlet listener, in the ServletContext (context objects), Session (sessions) and request (request) of these three objects on the monitor, you can monitor the object creation, destruction, add attributes, remove the property,

  • Servlet Listener using simple Web site traffic and online statistics 2010-03-09

    Servlet listener there are three, in the ServletContext (context objects), Session (session) and request (a request) to monitor the three objects, you can monitor the object of creation, destruction, add property, remove the attribute, and changes in

  • HttpSessionListener statistics online 2010-03-22

    Often needed in the website statistics online. The general practice is a combination of the past, log in and out Gongneng, that is, when the user enter a user name password to log the time counter plus 1, and then when the user clicks on the eject bu

  • An analysis of apache logs, statistics ip access, if the number exceeds a certain ip to access the value of short interest is automatically sent to the system maintenance personnel shell 2010-02-23

    webpay there have been some malicious access problems, which wrote this shell. The shell is read webpay. apache log is recorded in the system log. Change ip shell will analyze the statistics of visits, if it exceeds the specified value, the system wi

  • JSP Statistics Online User Information 2010-04-10

    Recently as a site of small online user statistics function, I use the Char Ext3 for the display. Can be year, month, date display the traffic statistics. Also thought about using some framework for dynamically generated images, but this would genera

  • Oracle database tree menu Statistics (connect by prior, sys_connect_by_path) 2010-04-21

    Recent statistics system at work need to access the various menus, these conditions can be accessed from the user access log table. Tree menu ID because the entire system is not designed according to some law, father and son on the menu in the menu I

  • Android Intent Action Daquan 2010-05-06

    String ADD_SHORTCUT_ACTION action: in the system to add a shortcut. . "Android.intent.action.ADD_SHORTCUT" String ALL_APPS_ACTION action: list of all available applications. Input: None. "Android.intent.action.ALL_APPS" String ALTERNAT

  • Online traffic statistics and the number of design 2010-05-16

    Servlet listener there are three, in the ServletContext (context objects), Session (session) and request (a request) to monitor the three objects, you can monitor the object of creation, destruction, add property, remove the attribute, and changes in

  • web server log statistics tool - awstats 2010-06-04

    Awstats is a free, very simple but powerful statistical tools have personality. It statistics for your site the following information: a: visited, number of visits, page views, hits, traffic, etc. II: precision of monthly, daily, hourly data 3: Natio