You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1016 B
39 lines
1016 B
package com.tptj.demo.hg.global.filter; |
|
|
|
import com.fanruan.api.log.LogKit; |
|
import com.fanruan.api.web.FlushKit; |
|
import com.fr.decision.fun.impl.AbstractGlobalRequestFilterProvider; |
|
|
|
import javax.servlet.FilterChain; |
|
import javax.servlet.http.HttpServletRequest; |
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
/** |
|
* @author 秃破天际 |
|
* @version 10.0 |
|
* Created by 秃破天际 on 2021-03-26 |
|
* 这是一个错误的场景使用示例! |
|
**/ |
|
public class ErrorDemo extends AbstractGlobalRequestFilterProvider { |
|
|
|
@Override |
|
public String filterName() { |
|
return "Error Demo"; |
|
} |
|
|
|
@Override |
|
public String[] urlPatterns() { |
|
return new String[]{ |
|
"/decision/error/demo" |
|
}; |
|
} |
|
|
|
@Override |
|
public void doFilter(HttpServletRequest req, HttpServletResponse res, FilterChain chain ) { |
|
try{ |
|
FlushKit.printAsString(res,"This Is A Error Demo!"); |
|
}catch(Exception e){ |
|
LogKit.error(e.getMessage(),e); |
|
} |
|
} |
|
}
|
|
|