|
From: Seth L. <set...@gm...> - 2004-07-29 01:29:26
|
> The whole point is that the view name still doesn't have any meaning to
> the controller. It's a logical identifier as far as the controller is
> concerned (the controller only deals in terms of names it gets as
> properties), but this is one mechanism for the resolving machinery to
> tell one target view from another.
Yes, good point.
If I read you correctly, it sounds like the controller is making the
decision to redirect or not. You could set two view names into the
controller, and give them meaningful names. The business logic in the
controller will chooses which view name to forward on to. But the
words "redirect" are now left out. The two view names you give to the
Controller are mapped normally.
Something like:
if (xxx) {
return new ModelAndView("viewA");
} else if (XXX and YYY) {
return new ModelAndView("viewB");
}
where:
viewA is JstlView
viewB is RedirectView
Not sure if that's cleaner, though. It does remove any references to
redirecting inside the controller (both RedirectView and redirect: are
gone).
Seth
|