mvc:annotation-driven' must have no character or element问题

使用SpringMVC,启动tomcat报这个错误

解决办法

首先将Spring版本提升到3.1及以上

如果还不行替换xml文件头部:

[html]  view plain  copy
 
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <beans xmlns="http://www.springframework.org/schema/beans"  
  3.  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"  
  4.  xmlns:mvc="http://www.springframework.org/schema/mvc"  
  5.  xsi:schemaLocation="http://www.springframework.org/schema/beans  
  6.       http://www.springframework.org/schema/beans/spring-beans-3.2.xsd  
  7.       http://www.springframework.org/schema/context   
  8.       http://www.springframework.org/schema/context/spring-context-3.2.xsd  
  9.       http://www.springframework.org/schema/mvc  
  10.       http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">  

你可能感兴趣的:(mvc:annotation-driven' must have no character or element问题)