仅供参考-接上文 springmvc 1.设置Log4jConfigListener日志监听(可以为开发调试.发布后运行的意外调试.等) 在src/main/resources目录下新建log4j.properties文件(可以在别的目录),这些配置内容网上有很多, # This is the configuring for logging displayed in the Application Server log4j.rootCategory=error, stdout, logfile
统计页面浏览次数:使用的是servlet实现统计次数传递给JSP页面 说明:我做的都比较接地气,意思就是比较简单! 效果图如下: 上代码 counter.java(它真的好简单,啥事不干,只是定义一个访问次数的基值): package util; public class Counter { public static int COUNT_ONLINE=1; } Count.java(servlet):它负责处理业务逻辑,获取访问次数并传递给JSP页面 特别注意:ServletContext s