2011-12-13 41 views

回答

3

不,這是不可能的。您必須在doFilter()方法中使用自己的URL模式。地圖上/*過濾器,並執行以下任務:

HttpServletRequest req = (HttpServletRequest) request; 

if (req.getRequestURI().startsWith("/public/")) { 
    chain.doFilter(request, response); 
    return; 
} 

// ... 

或當實際有一個上下文路徑:

HttpServletRequest req = (HttpServletRequest) request; 

if (req.getRequestURI().startsWith(req.getContextPath() + "/public/")) { 
    chain.doFilter(request, response); 
    return; 
} 

// ... 
+0

感謝。我也這麼想。 – 2011-12-14 14:51:45