|
From: <jue...@we...> - 2004-11-10 09:22:34
|
By default, ViewResolvers are detected by type. If you want to have a = single ViewResolver proxy that in turn delegates to a set of backend = ViewResolvers, you can either define those backend ViewResolvers as = inner beans of the ViewResolver proxy definition (inner beans are = ignored when detecting by type), or switch your DispatcherServlet's = "detectAllViewResolvers" flag to "false" (via a corresponding init-param = in web.xml). In the latter case, the dispatcher will look for a single = ViewResolver bean named "viewResolver" and ignore all others; that = single ViewResolver is then able to delegate to backend ViewResolver = beans. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Alessandro Di Bella Sent: Wednesday, November 10, 2004 10:10 AM To: spr...@li... Subject: [Springframework-developer] RE: Using multiple view resolvers Hi J=FCrgen=20 I understand now. A solution I thought of is to create my own = ViewResolver=20 that acts as a proxy and depending on some criteria it will delegate to = the=20 appropriate ViewResolver. I still have a problem though, if I have more = than=20 a bean that implements org.springframework.web.servlet.ViewResolver, how = do I=20 tell the servlet which one to use? Thanks Alessandro j=FCrgen h=F6ller [werk3AT] wrote: > Hi Alessandro, >=20 > Spring's view names are supposed to be global for the scope of a > DispatcherServlet. Hence, all controllers in the same dispatcher will > share a single view namespace. There is no support for having "local" = view > names that just apply to a specific controller, with different = controllers > returning the same view names but referring to different views. >=20 > Essentially, Spring does not use the same view name semantics as = WebWork > here, where view names are usually local: for example, "success" or > "form". View names in Spring are rather meant to refer to shared = physical > resources, thus being global (for the scope of a dispatcher): for = example, > "orderForm" or "orderList". >=20 > If you still want to use local-style view names, you could collect = some of > your controllers into a separate DispatcherServlet context, having = their > own view namespace there. Or you could use controller-specific = prefixes > for view names. >=20 > Juergen >=20 >=20 > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On = Behalf > Of Alessandro Di Bella > Sent: Tuesday, November 09, 2004 6:29 PM > To: spr...@li... > Subject: [Springframework-developer] Using multiple view resolvers >=20 >=20 > <posted & mailed> >=20 > Hi, >=20 > I apologize for posting this in the developer list but i did not get = any > answer in the users one and I'm stuck. >=20 >=20 > I'm trying to put together a web app and I'm trying to understand how = to > use the view resolver. I should to get the XmlViewResolver to work but = i > don't understand how I can associate a specific resolver with a > controller. I'll explain better. I have a MultiActionController e = several > SimpleFormController(s) that are mapped to different paths. > I would like to be able to say that if the request is handled by the > MultiActionController, the views sholuld be resolved by the > XmlViewResolver while if the request if handled by = SimpleFormController > foo, the views should be resolved by the resolver bar. >=20 > Is this possible? >=20 > Thanks >=20 > Alessandro >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=3D5588&alloc_id=3D12065&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_idU88&alloc_id=12065&opclick ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_idU88&alloc_id=12065&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |