Just to explain why you shouldn’t use PrettyContext to get the URL: The PrettyContext returns always the original URL that was received from the browser. After the first call of your dynaview method the resulting viewID will be internally forwarded in the container. The forwarded requests will hit the PrettyFilter again and will match the URL pattern again. So your dynaview method will be called again. If you use the PrettyContext to obtain the URL you will get the original URL again (that one you already got in the first call) and so you will get into an endless loop.
Do you play Magic?
Get TopDecked MTG, the #1 Magic App, built by players, for players. Free to use, forever.