On Sun, Oct 20, 2013 at 3:17 AM, Mo Maison <[email protected]> wrote:

> Not sure this is related, as filter seems to be executed twice, but in
> case :
> if you forward your request, by default the request is not filtered again :
> it depends on filter mapping dispatchers. See for example
> http://stackoverflow.com/questions/2968621/dispatcher-for-filter-mapping
>

I actually originally took advantage of this idea in order to not have some
filters run twice.  However, since I'm using 3 specific filters I couldn't
leave it this way for good.  Specifically, I'm using:

  - Guice Persist to start a transaction on requests
  - Shiro for security
  - UrlRewrite to send all requests to the main index per angular html5


In order for Shiro to redirect correctly on login, it has to be in this
order, otherwise shiro will see all requests as going to the index page.
And the general "best practice" appears to be to always start a transaction
first thing in the filter chains (and I also want to record attempted
logins into the database, so need a transaction).  So, I moved all filter
and servlet configuration to be inside of Guice, which means they are all
in the same filter chain and all configured to always fire.

This make sense?

Thanks!

-josh

Reply via email to