|
From: Darren D. <da...@da...> - 2004-03-11 11:11:32
|
We have a concrete requirement to be able to override a viewname selected by a controller in a postHandle() method of an interceptor. Specifically it's for defining potentially very different views for very different device types that may be accessing the resources. Ideally I don't want myriad controllers to care what the client device is= , so I want to use an interceptor to suffix the viewname before the dispatcher resolves it. The interceptor can then be quite flexible - providing bean properties to specify which request header to look in and one to specify a regular expression to pattern match against. I can't retrieve the View from the MAV and set, say, a different Velocity template name, or JSP location, or XSLT stylesheet and unfortunately, there's no setView() or setViewName() in the immutable ModelAndView class which would seem to be the easiest and most obvious fix. What would the issues be in adding them? Alternatively, is there another or better way to meet this use case? Regards, --=20 Darren Davison Public Key: http://www.davison.uk.net/key.jsp |