|
From: Christophe V. <c.v...@pa...> - 2003-11-11 22:21:58
|
On Tuesday 11 November 2003 21:30, Darren Davison wrote: > On Tuesday 11 November 2003 12:53, William G. Thompson, Jr. wrote: > > You seem to be describing a Portal which has two parts > > --snip-- > > > Each Portlet is in essence a separate web app and could use the standard > > Spring MVC model with some slight modifications > > If the app really is a portal, then this is valid, but my impression was > the OP was talking about instances where controllers have to return model > data that is peripheral to the user's request, but still very definitely an > integral part of the one web application. > > For example, a controller may process a search request and return a model > comprising a List of SearchResult objects. The view still needs to be > built with (for example) a left-side navigator that depends on database > content. Should every controller within the application be made aware of > how to retreive this part of the model? > > If I understand correctly, that's the sort of scenario being described..? > > Best wishes, You can handle such cases using the tiles support in Spring. Define a component in tiles, and designate a ComponentControllerSupport subclass to it in your tiles config file, like this: <definition name="name" page="/somepage.jsp" controllerClass="subclass of ComponentControllerSupport"/> In that subclass, you fetch all the data that is required as the model for the view (the tiles component, which is a regular jsp page). There is some info at www.springframework.org/docs/integration/tiles.html , but the controllers are not mentioned. -- Kind regards, Christophe Vanfleteren |