|
From: Colin S. <col...@ex...> - 2004-07-28 18:37:15
|
I'm working with an app (original source is not by me) that currently has some pretty nasty view handling. It uses TilesJstlView, but for some view properties the controller is actually aware that the view names represent a need to redirect, and in those cases the controller returns a new RedirectView it creates itself. I think this is pretty unclean. Does anybody think it's worth having a new standard view resolver of some sort that can be chained in front of other resolvers (such as in this case TilesJstlViewResolver), and can recognize view names which include a prefix meaning this is a redirect view? I.e. RedirectViewResolver would recognize view names of the nature redirect:/some/external/path and use a redirectView in that case? If they don't have the prefix, it doesn't do anything and lets the next resolver get a whack at it. Another standard view resolver I could see being handy is a regex view resolver, where there is a composite pattern being used. The resolver has 1 to n other view resolvers registered with it, and for each one, a regex. If there is a regex match, then it delegates to the view resoler or chain of view resolvers set up for that regex. Colin |