Вот код фильтра:
| Код | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if (debug) log("mainFilter:doFilter()");
doBeforeProcessing(request, response);
Throwable problem = null; try {
request.setAttribute("count", "0"); //вот банально я пытаюсь избежать рекурсии, ведь request один и от же if(!request.getAttribute("count").equals("1")) { RequestDispatcher dispat = request.getRequestDispatcher("/index.htm"); dispat.forward(request, response); request.setAttribute("count", "1"); } else chain.doFilter(request, response); } catch(Throwable t) { problem = t; t.printStackTrace(); }
doAfterProcessing(request, response);
if (problem != null) { if (problem instanceof ServletException) throw (ServletException)problem; if (problem instanceof IOException) throw (IOException)problem; sendProcessingError(problem, response); } }
|
Сейчас посмотрю интерсепоторы, но мне бы очено хотелось понять что тут не так с этим фильтром... |