Spring常见问题解决办法汇总

解决The prefix 'context' for element 'context:component-scan' is not bound
<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"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/aop
          http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">

</beans>

<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:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework/org/schema/beans/spring-beans-3.0.xsd">

http://www.cnblogs.com/pipicoming/archive/2013/12/16/3476235.html

No grammar constraints (DTD or XML schema).....两种解决方法
方法一:常用方法   关闭XML验证
工具栏:windows => preferences => xml => xml files => validation => Indicate when no grammar is specified:选择Ignore即可。
 
方法二:(个人推荐)
添加 内容如下
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd">
http://blog.csdn.net/xwin1989/article/details/6754790
http://blog.sina.com.cn/s/blog_6b8f1feb01010y5a.html

cvc-complex-type.2.4.a: Invalid content was found starting with element 'para-names'. One of '{"http://
 java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":param-name}' is
 expected.
解决办法:
将web.xml中

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

替换为

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
上一篇:android 支持的语言列表(汇总)


下一篇:难以接受你的改变:从project.json到.csproj