开发者

Loading external xsd and dtd render my application long start up time

I'm developing a webapp using tiles and spring mvc. With the use of xsd and dtd validation on the definition of tiles and bean declaration of spring mvc, 开发者_StackOverflow社区each time the web app is start/restart, then requests are sent to external server for xsd and dtd files. I notice that because my webapp failed to start casually due to failed request to external server (!!!). I wonder if there is a way to tell my app to stop doing that? Like place a cached version of these files somewhere, or tell the Xml Processor to not valid these xml files at run time?


I'm facing a similar problem (but with xsd files.) After a little research, it appears that generally, foo-1.0.jar will contain foo-schema-1.0.xsd and therefore when foo goes to validate its foo-config.xml, it doesn't need to ask the Internet for the xsd.

The problem comes when you upgrade to foo-1.1.jar (which includes the new foo-schema-1.1.xsd) without changing your foo-config.xml to reference the new version of the schema. foo-1.1.jar doesn't contain foo-schema-1.0.xsd, so the parser looks for it on the Internet. If the site is trying to look at is down, you have problems.

So check your xml files to make sure they're referencing the version of the xsd/dtd appropriate for the jar version which is validating them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜