Filter 配置多個URL PATTERN

2021-08-26 21:11:49 字數 444 閱讀 4084

最近做專案遇到乙個filter需要配置多個url-pattern,上網查了下資料,經測試,現總結下

一、完全錯誤的方式

authority

com.util.authorityfilter

/pages/cmm/*;/pages/genbill/*

二、有一定作用,但不能實現需要的效果,只會過濾最下面配置的url-pattern。

authority

com.util.authorityfilter

/pages/cmm/*

/pages/genbill/*

三、現在給出正確的配置方式

authority

com.util.authorityfilter

/pages/genbill/*

/pages/cmm/*

Filter需要配置多個url pattern

最近做專案遇到乙個filter需要配置多個url pattern,上網查了下資料,經測試,現總結下 一 完全錯誤的方式 authority com.util.authorityfilter pages cmm pages genbill 二 有一定作用,但不能實現需要的效果,只會過濾最下面配置的ur...

Filter配置總結

1。如果要對映過濾應用程式中所有資源 loggerfilter myfilter.loggerfilter 2.過濾指定的型別檔案資源 loggerfilter myfilter.loggerfilter html 其中 html要過濾jsp那麼就改 html為 jsp,但是注意沒有 斜槓 如果要同...

關於Filter的配置

配置 onefilter onefilter my.filter.com.onefilter 注意 dispatcher的值 a.request 當使用者直接訪問頁面時,web容器會呼叫過濾器,如果目標資源是通過requestdispatcher的include 或者forward 方法訪問,那麼該...