javalite / activeweb

ActiveWeb moved, see below

Home Page:http://javalite.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Active web blocks processing of further filters

tekbird opened this issue · comments

If I have another filter defined in web.xml after the one for ActiveWeb, its doFilter method does not get called. For example, consider the following definition from web.xml

<filter-mapping>
		<filter-name>dispatcher</filter-name>
		<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
		<filter-name>logger</filter-name>
		<url-pattern>/*</url-pattern>
</filter-mapping>

The doFilter of logger is not invoked after dispatcher (org.javalite.activeweb.RequestDispatcher) handles the request.

this is a function of Servlet API. If you do not want the dispatcher to capture ALL requests, do not use <url-pattern>/*</url-pattern>

Also, you do not really need a logger filter, as logging is built-in. In your controllers, you can just:


logInfo(...);
logWargning(...);
logError(...);

In addition, the framework will log every request anyway.