|
From: Rob B. <cro...@ya...> - 2004-12-08 21:08:59
|
GREAT! Will this make it into 1.1.3? Thanks jürgen, your efforts are greatly appreciated. Rob --- jürgen höller [werk3AT] <jue...@we...> wrote: > OK, I'll add an "attributes" property of type > java.util.Properties and an "attributesMap" property > of type java.util.Map to UrlBasedViewResolver. The > first can be populated via <value> or <props>; the > latter is meant to be populated via <map> but also > allows specifying direct entries like <property > name="attributesMap[key1]"><value>myValue</value></property>. > > "attributesCSV" doesn't make too much sense on a > ViewResolver, as it's really just meant for view > definitions in properties file (read by > ResourceBundleViewResolver). For this reason, I'm > not keen on introducing it on UrlBasedViewResolver. > > Juergen > > > ________________________________ > > Von: > spr...@li... im > Auftrag von Rob Butler > Gesendet: Di 07.12.2004 20:44 > An: spr...@li... > Betreff: Re: [Springframework-user] Velocity Tools > and Spring MVC > > > > Actually, things may not be as clear as I thought. > > > > I understand your argument of allowing > > > Spring-managed placeholders; that's why I > pointed > > > out the "attributes" support. AbstractView's > > > "attributes" and "attributesCSV" are indeed just > > > suitable for String values, but "attributesMap" > > > allows any Object as value: You could define > inner > > > beans of type java.lang.Integer or the like > there, > > > to get values of specific types. The problem of > > > getting special types for map values is not > > > restricted to VelocityView; it's the same for > any > > > other type of Spring-defined bean, so needs a > > > generic solution. > > Ok, I agree with everything above. But here's the > problem. I can add an attribute to a view, but if I > have 30 views in my application, and I want the same > property exposed to all 30 views, I then must define > 30 view beans in my spring config (yuck!). There is > currently no way to set attributes in a view > resolver > so that the attributes are added to all views > created > by that resolver. > > Can you add a setAttributes(Properties prop), > setAttributesMap(Map), and a > setAttributesCSV(String) > method to the > org.springframework.web.servlet.view.UrlBasedViewResolver > class? This would then allow you to add properties > to > the view resolver, so the properties are then > available in all views created by the resolver. > Since > this is a base view resolver, the functionality > would > be available to all other view technologies too, so > it > is a generic solution. > > Thanks. > Rob > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage > less. > http://info.mail.yahoo.com/mail_250 > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT > Products from real users. > Discover which products truly live up to the hype. > Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Springframework-user mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-user > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT > Products from real users. > Discover which products truly live up to the hype. > Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com |