进入碰见一个奇怪的Filter问题。 在web.xml 上配置
        <filter>
<filter-name>UrlFilter</filter-name>
<filter-class>Bean.MyUrlFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>UrlFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>MyUrlFilter.java代码 DoFilter方法:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpReq=(HttpServletRequest)request;
String strUri = (httpReq.getRequestURL()).toString();
String rootpath = httpReq.getRealPath("/");
writeLog("127.1.1.1", rootpath, "Filter", "URI="+strUri);  //记下URI, writeLog定义在下面
chain.doFilter(request, response);
}这样预期的结果应该是:
所有request都会走这个Filter, URI还会被记录下来。 在本地测试,确实是没错。 所有html, jsp, servlet, jpg, css等都会走filter但是上传到虚拟主机后, 发现 只有 存在的 jsp, servlet才走 Filter。   所有html, jpg, css的都不走filter.