Search code examples
spring-mvcxmlschemasetspring-config

schema not works when no internet connection


schema works fine during internet connection but it shows me following warning message when internet connection is off

No grammar constraints (DTD or XML Schema) referenced in the document.

i have used following schemas in spring-dispatcher-servlet.xml

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xsi:schemaLocation="http://www.springframework.org/schema/beans     
        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-4.0.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">

what should i do to fix this problem?


Solution

  • First, you are using the schema which is a public URL. It is obvious trying to download from the internet.
    If you use relative path for the downloaded schema, it should work (but it is not recommended)

    EDIT:
    After going through some posts, I found this example.Hope it helps