網(wǎng)站開發(fā) filter在網(wǎng)頁中如何運用呢?
filter在網(wǎng)頁中如何運用呢?//Filter可以獲取請求對象并將其轉(zhuǎn)發(fā)給其他HTML、JSP、servlet和其他公共void dofilter(ServletRequest、servletres
filter在網(wǎng)頁中如何運用呢?
//Filter可以獲取請求對象并將其轉(zhuǎn)發(fā)給其他HTML、JSP、servlet和其他公共void dofilter(ServletRequest、servletresponse、filterchain chain)拋出IOException、ServletException{if(condition){系統(tǒng)輸出打?。ā斑^濾器”)請求.getRequestDispatcher(" 索引.jsp“)。轉(zhuǎn)發(fā)(請求、響應(yīng))}否則{鏈.doFilter(請求,響應(yīng))}