I need to instantiate 1 Map<String,String> bean in my ApplicationContext.xml file that contains map entrys with value strings that contain html, with syntax for Freemarker variables, which is exactly the same as the placeholder syntax. I.E below in the Map bean definition the text contains ${User_Role} which is a freemarker variable that will be substituted by the freemarker engine at view rendering time.
Loading ApplicationContext.xml fails with ...beans.factory.BeanDefinitionStoreException: with the error message "Could not resolve placeholder 'User_Role' which is throw from ...factory.config.PropertyPlaceholderConfigurer.pr ocessProperties() method.
After reading the IOC Container docs, examining Spring sources and searching the forums, i have not been able to find anything on how to suppress the use of the PropertyPlaceholderConfigurer for so i can create this 1 bean and suppress having the map's xml definition (below) scanned for placeholder "substitutions", which can't be resolved.
Is there some way to use a "BeanFactory" as a child context of the ApplicationContext and load this bean
definition from it own "myOneBean.xml" bean config file and still create a bean i can then inject into
the FreemarkerConfigurer?
As i understand (poorly, no doubt) the BeanFactory does not support the PostProcessors that are preventing creating the bean with these strings in the Map.
Or maybe there is some way to disable the PostProcessors for just this one bean definition by defining a factory-bean attribute on the HashMap bean, but which factory bean to use that won't call the FactoryBean post-processors is not something i could ferret out.
Code:<bean id="fmSharedVars" name="appSharedVars" class="java.util.HashMap" > <constructor-arg> <map key-type="java.lang.String" value-type="java.lang.String"> <entry key="xml_escape" value-ref="fmXmlEscape"/> <entry key="_HOME_LINK_" > <value><![CDATA[<a href="/testAppl/HomeView.html?${User_Role}" title="Home"><span>Home</span></a>]]></value> </entry> </map> </constructor-arg> </bean> <bean id="freeMarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> <sniped other property elements> <property name="freemarkerVariables" ref="fmSharedVars" /> </bean>



Reply With Quote

, what i want is to construct JUST the Map bean without placeholder substitution, WHILE leaving all the other beans created in the same ApplicationContext WITH placeholder substitution, and neither of these obvious changes would allow the other beans, which depend on property placeholder substitution, to be created. 
