Results 1 to 3 of 3

Thread: XmlViewResolver and WebApplicationContext

  1. #1
    Join Date
    Sep 2004
    Posts
    10

    Default XmlViewResolver and WebApplicationContext

    I am using XmlViewResolver and want to set a property on one of the beans in views.xml that is a reference to a bean in the WebapplicationContext.
    This does not seem to work. Is XMLViewResolver not context-aware?

    Can anyone suggest an alternate solution if there is no way to make the context available to beans in views.xml?

    Thanks,
    -evan

  2. #2
    Join Date
    Aug 2004
    Location
    Amsterdam, Netherlands
    Posts
    450

    Default

    The XmlViewResolver uses an XML file to resolve its views. The XML file itself is indeed a BeanFactory, but doesn't have any links to other application contexts. You're better off using the BeanNameViewResolver, which resolves views wired up in your application context (basically the same as the XmlViewResolver, except for the fact that the context used is now hte webappctx).

    I guess you're aware of the fact that by using the contextConfigLocations init-param in your web.xml you can link in additional context files (might be handy if you need to spread the bean definitions, for example your views across multiple files).

    cheers,

    Alef

  3. #3
    Join Date
    Sep 2004
    Posts
    10

    Default

    Thanks for the info,
    I have decided to just use getWebApplicationContext() within the view to retrieve the bean for the time being.

    -evan

Similar Threads

  1. Replies: 1
    Last Post: Feb 15th, 2008, 04:36 AM
  2. Replies: 0
    Last Post: Jul 19th, 2005, 04:42 AM
  3. Replies: 0
    Last Post: Nov 3rd, 2004, 05:37 AM

Posting Permissions

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