Announcement Announcement Module
Collapse
No announcement yet.
Problem opening applicationContext.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem opening applicationContext.xml

    hey all,
    i have a class that due to design issue must get reference to the applicationContext.xml file explicitly to use the getBean method, the problem is that the file cant open the file, the .class file is located in the classes folder under WEB-INF... i dunno how to give it a relative path to the file,
    i tried:
    1- applicationContext.xml
    2- WEB-INF/applicationContext.xml

    but always says file does not exist.....any help??
    thanks

  • #2
    One way would be to use WebApplicationUtils to resolve the WebApplicationContext.

    A more elegant solution would be for your class to implement BeanFactoryAware. That way the context would be injected into your class, freeing you from the lookup.

    Regards,
    Andreas

    Comment

    Working...
    X