nutzboot怎么自定义filter 有没有文档
7 回复
package cn.luozc.etu_web.filter;
import org.nutz.ioc.loader.annotation.IocBean;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@IocBean
public class LoginFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
System.err.println("sa");
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse res = (HttpServletResponse) response;
String contextPath = req.getContextPath();
System.err.println(contextPath);
chain.doFilter(request,response);
}
@Override
public void destroy() {
}
}
来个 pull request
https://nutzam.com/core/boot/write_starter.html
添加回复
请先登陆