Article From:

@Order(1)//The smaller the priority is, the higher the priority is

//filterName  Filter name urlPatterms address to filter
public class UrlFilter implements Filter {
private Logger logger = org.slf4j.LoggerFactory.getLogger(UrlFilter.class);
public void init(FilterConfig filterConfig) throws ServletException {
// TODO Auto-generated method stub“Initialize the address filter,, “,”);

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// TODO Auto-generated method stub
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
String sendCharSet = httpServletRequest.getCharacterEncoding();
String sendUrl = httpServletRequest.getRequestURI();
String sendUrl_ =httpServletRequest.getQueryString();“String format —–> > > {} “, sendCharSet);“The prerequesting address is —–> > > {}, sendUrl + sendUrl_);
chain.doFilter(request, response);

public void destroy() {
// TODO Auto-generated method stub“Destroy address filter,, “);


Link of this Article: Spring-Cloud-Filter (filter)

Leave a Reply

Your email address will not be published. Required fields are marked *