返回

spring边边角角

我们在使用ssh框架的时候,很多人抱怨为什么之前都运行得好好的,第二天就报错了,我也是被这个问题纠结了很久。

我们来看看spring的配置文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context-2.5.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd" default-autowire="byName">
 这是spring的配置文件头。

spring-beans-2.5.xsd文件是spring连接网络地址后下载的东西,如果你修改了spring的文件头,并且需要下载新的xsd文件,或者其他原因,删除了该文件,spring当然就报错了,当你把鼠标放在小红叉上,它会提示你找不到该文件。

其实spring联网是很有必要的,当你不需要配置tx标签,你可以删除xmlns:tx="http://www.springframework.org/schema/tx" http://www.springframework.org/schema/tx ,它就不会去官网下载。

posted @ 2013-06-22 07:32  feige_hunter  阅读(164)  评论(0编辑  收藏  举报