Results 1 to 2 of 2

Thread: Problem opening applicationContext.xml

  1. #1
    Join Date
    Apr 2008
    Posts
    4

    Default 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. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •