派克495 2022-01-12 16:46 采纳率: 91.3%
浏览 10
已结题

Log4jNDCFilters 里有这样一段代码,all(controller : '✵' , action : '✵' )是什么意思?

class Log4jNDCFilters{
def springSecurityService
def filters = {
    all(controller : '*' , action : '*' ){
             before = {
                 def username = springSecurityService.getCurrenUser()?.username
                 NDC.push(username );
              }
             afterView = {Exception e ->
                   NDC.remove()
              }
     }
}

这段代码是什么意思?尤其是all(controller : '' , action : ''),before和afterView 。一般这个类是怎么调用的?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 1月20日
    • 创建了问题 1月12日