Results 1 to 2 of 2

Thread: cannot access a bean defined in dispatcher Servlet's xml

  1. #1
    Join Date
    Jan 2009
    Posts
    1

    Unhappy cannot access a bean defined in dispatcher Servlet's xml

    We have a spring bean defined in one of our dispatcher Servlet's xml (i.e., dg-servlet.xml).

    <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freema rker.FreeMarkerConfigurer">
    ...
    </bean>

    We would like to access it from application context. But it cannot be found either by referring it in the application-context.xml or programmaticlly.

    How do we solve this problem?

    Thank a lot!

  2. #2
    Join Date
    Oct 2008
    Location
    Delhi, India
    Posts
    163

    Default

    You're doing it wrong. Inject the bean wherever you need it.

Posting Permissions

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