Hello Howard et al,

On Mon, Apr 29, 2013 at 5:55 PM, Howard W. Smith, Jr. <
smithh032...@gmail.com> wrote:

> Leon,
>
> On Mon, Apr 29, 2013 at 11:02 AM, Leon Rosenberg
> <rosenberg.l...@gmail.com>wrote:
>
> Back to your question, filter is ok, too many filters are making stack
> > traces fuller than needed, and the order of the filter could be a
> problem.
> > Listener is asked _before_ anything happens.
> >
>
> Good point(s).
>
> About how many filters are you trying to consolidate by using this
> approach?
>
> I have seen recommendations of adding filters for file types, filters for
> login/session-management, etc... I have taken those concepts and put those
> in one filter which I have implemented and maintain and have done my best
> to ensure that it is 'thread-safe' as well. Some months ago, I reported an
> issue to tomcat JIRA/issue list, and those guys shot down my filter and
> said that it is not thread-safe. Since then, I have made some code changes
> in the filter and related sources (referenced by the filter), and did my
> best to make sure it is more threadsafe, even did some research on
> thread-safe filters (when injecting via CDI), etc...
>
> also, I am using OmniFaces gzip filter. To my knowledge, that is 2 filters
> in my app, that I see in stacktrace, when I have issues to
> troubleshoot/debug. When I am debugging, I often wonder why 'filter' show
> up all the time in stacktrace, but then of course, I have to remember that
> every user/HTTP request has to pass through the filter. So, okay, moving
> forward, ignore the fact that the (only) filter(s i have in my app) showed
> up in the stacktrace.
>

Whether you want to have multiple filters or not is a decision based on
your coding guidelines, architectural principles and what not.
Since you are the only user of your filters, it's free to you to use as
many (or few) filter as possible. Personally I would like to separate by
concerns and have multiple filters, because it makes it easier to use,
maintain and test. But this is personal opinion.
However, in my case, I am developing a library that is used by others in
their projects (http://moskito.anotheria.net). It comes already with 8
filters (
http://server04.test.anotheria.net:8080/moskitodemo/mui/mskShowProducersByCategory?pCategory=filter)
and this is a lot. Of course the end user (developer) only chooses the
filters he needs, and not everyone needs everything. However, since its a
lib, you don't want it to show up in your stack traces every request, you'd
rather forget, that you have it at all. Therefore I'm trying to choose a
less visible approach ;-) Also it's easier to add one listener to web.xml
as to add a listener AND a filter. And I need the listener, to know when
sessions expire anyway ;-)
But again, your situation is obviously different from mine ;-) But if you
want to count sessions and all the other funny stuff, give moskito a
chance:

https://confluence.opensource.anotheria.net/display/MSK/HowTo+embed+MoSKito+WebUI+into+a+maven+built+war
https://confluence.opensource.anotheria.net/display/MSK/Integration+Guide

regards
Leon


>
>
>
> > regards
> > Leon
> >
> >
> > On Mon, Apr 29, 2013 at 4:59 PM, Howard W. Smith, Jr. <
> > smithh032...@gmail.com> wrote:
> >
> > > On Mon, Apr 29, 2013 at 10:54 AM, Christopher Schultz <
> > > ch...@christopherschultz.net> wrote:
> > >
> > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > Hash: SHA256
> > > >  >
> > > > >> Even, the requests are keepalived they look to me as if they were
> > > > >> executed parallel. At least from the chrome timeline. But its
> > > > >> hard to tell without further investigation.
> > > >
> > > > Yeah, you might have to use a packet-sniffer.
> > > >
> > > >
> > > definitely sounds like overkill. how much code you need to write for
> > such a
> > > thing, all because one would want to avoid using a filter???
> > >
> >
>

Reply via email to