Announcement Announcement Module
Collapse
No announcement yet.
Passing the active ContextLoader to a bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing the active ContextLoader to a bean

    Hi,
    How would one access the ContextLoader in the applicationContext.xml file that that the ContextLoader is processing? Ultimately I would like to pass it to a bean. e.g.
    <bean id='myBean' class='com.xyz.util.SomeBean'>
    <property name='context' ref='this'/>
    </bean>

    where 'this' is the ContextLoader processing applicationContext.xml file.

    Appreciate any assist.

  • #2
    This may not be the club solution, but it at least works.
    I created a bean that implements ResourceLoaderAware and put it at the top of the applicationContext.xml file. The beans sole responsibility is to park the resource loader into a JVM Singleton so that other classes can later acquire resources relative to /WEB-INF.

    Comment

    Working...
    X