I implemented not usual architecture for Grails app because I made front controller which only forwards requests further (based on some criteria). I also implemented locale resolver as a http servlet request filter. And it turned out that forwarded request passes again through filter chain. So flow looks like this:
- A request arrives to grails app
- The request passes through my filter
- The front controller gets the request and forwards it further
- The forwarded request passes again through my filter
- A back controller gets the request
In the mean time of writing this post I've come up how to omit the problem (my implementation specific). But still I'm curious why does it happen? Forward should work behind the scene. Java EE spec doesn't say anything about this behaviour (forward javadoc).
<dispatcher>
option. Now everything is clear. Have a nice coding ;) – Lobe