zoukankan      html  css  js  c++  java
  • Filter Big Picture

    The middle-tier component of the Java EE architecture consists of an application server often fronted by a web server. These servers serve up web content and execute servlets and JSP pages in response to incoming client requests. Figure 10-1 illustrates how client request flow through a stand-alone application server such as Tomcat.

    Filters can be used to do the following:

    1. Inspect the request header and data before it reaches the resouce
    2. Inspect the response header and data after it has been sent by the resource
    3. Provide a Modified version of the request to the resource being processed by the container.
    4. Access and modify the response from the resource before returning it .
    5. Stop a request from reaching a resource altogether.

    Filter life cycle is like servlet. Filter definition and filter mapping.

    Matching URL patterns:

    /*  Everything that is served by this web application, including static pages, servlets, and jsp pages.

    /servlet/*  All Servlets under the /servlet path

    /jsp/*.jsp

    /dept/accounting/*

    Filter chain:

    javax.servlet.Filter

    javax.servlet.FilterChain

    All filters are chainable.

  • 相关阅读:
    Windows下开发过程中常用的Linux指令
    flask sqlalchemy实现分页功能
    channel(3) 一 基本定义
    goroutine(2) goroutine同步
    goroutine(1) go的调度器
    go 语言 interface(接口 二)
    go 语言 interface(接口 一)
    go 语言 defer
    go 语言 闭包
    go 语言 函数
  • 原文地址:https://www.cnblogs.com/wucg/p/1877893.html
Copyright © 2011-2022 走看看