1.
word_file=/WEB-INF/word.txt
String configPath = filterConfig.getInitParameter(WORD_FILE);
String filePath = filterConfig.getServletContext().getRealPath(configPath);
2.
log4j-init-file=WEB-INF/config-file/log4j.xml
String file=getInitParameter("log4j-init-file");
String prefix=getServletContext().getRealPath("/");
String filePath=prefix+file;
3.
String request_uri=httpReq.getRequestURI(); //: /ch20/filter/test.jsp
String ctxPath=httpReq.getContextPath(); //: /ch20/filter
String strQuery=httpReq.getQueryString(); //?后面的字符串,如:a.jsp?user=lisi,那么返回:user=lisi
4.
httpReq.getRequestDispatcher(logon_page).include(httpReq,httpResp);
getServletContext().getRequestDispatcher(/logon_page).include(httpReq,httpResp);
httpResp.sendRedirect(index.jsp);
out.println("<a href="+httpResp.encodeURL("index.jsp")+"链接</a>");
httpResp.sendRedirect(httpResp.encodeRedirectURL("index.jsp"));
httpResp.sendRedirect(java.net.URLEncoder.encode("员工信息.html","UTF-8")) //重定向中文页面