Announcement Announcement Module
Collapse
No announcement yet.
DTD validation during initialization Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DTD validation during initialization

    Hi,

    When Spring starts up, I assumed it needed access to the network in order to validate the DTDs when parsing beans. However, when I ran my unit tests locally with my machine unplugged from the network I found that Spring initialized my beans and the tests ran fine.

    So I'm wondering:

    1) Does Spring attempt to load the DTDs referenced in the config files (e.g. http://www.springframework.org/dtd/spring-beans.dtd) but turn off validation if they're not available?

    2) Which class controls this behavior? XmlBeanDefinitionReader? Is it possible to set a custom EntityResolver to control this behavior more explicitly?

    thanks,

    -- James

  • #2
    I think the XmlBeanDefinitionReader loads the dtd from spring.jar.

    Comment


    • #3
      ah, yes, I see it in there now.

      thanks!

      Comment


      • #4
        Indeed it does - however, if you really want to use the DTD from over the wire you should look into your XML parser documentation - you can manually set the location to be used when looking for a DTD.

        Comment

        Working...
        X