8.MVC和过滤器Filter

一.MVC三层架构

现在的三层架构:

二.Filter过滤器(重点)

1.Filter介绍:

2.Filter开发步骤:

  • 导包

  • 编写过滤器

(1)导包

(2)编写过滤器

三.监听器

使用场景:可以记录当前访问人数(监听Session个数)

开发步骤:

  1. 编写一个监听器,实现监听器接口

  2. 配置web.xml注册监听器

编写监听器:

配置web.xml注册监听器

 

posted @ 2020-02-16 00:37  All_just_for_fun  阅读(132)  评论(0编辑  收藏  举报