I have an entry in my servlet.xml,
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr
Now, what I think is, dwr is the prefix we are going to use, like
<dwr:configuration>
<dwr:convert type="bean" class="com.abc.bean.MyBean" />
</dwr:configuration>
Now the problem is, if the site http://www.directwebremoting.org is down then my application is unable to create the beans.
-
Is it going to hit this website every time beanfactory creates the bean?
-
Is there any alternative so that I can use dwr, without hitting their website?
Complete header:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
The problem is probably not directly related to the namespace per se, but to the schema location of this dwr namespace.
Whereby the URI used as the namespace identifier can be “anything” and is not accessed to process the file (we use Internet domain based namespaces IDs as a convenient way to have globally unique namespaces), the schema location is effectively accessed.
To fix the problem, you may be able to download the schema, publish it on a reliable site, and alter the schema location in the XML files which reference it.
The “schema” is the DTD, or more typically nowadays, as is the case here an XSD file. In practical terms, you need to download the following.
You can then publish the spring-dwr-2.0.xsd on an server of your own (or you can make it available in a directory, if these are not online applications), and change the corresponding line in the XML header to read (where MyOwnDomain, etc. reflects your actual site of course):
In that fashion, even when the directwebremoting.org site is not available, there will be no delays in your XML processing logic.
Attention, it is quite possible that the XSD in question makes reference to other schemas, and if that were the case you’d also want to download these and ensure the XSD points to the new location as well for these.