zoukankan      html  css  js  c++  java
  • Spring—Document root element "beans", must match DOCTYPE root "null"分析及解决方法

    网上很多人说要把applicationContex.xml文件中加上如下第二行的<!DOCTYPE/>标签,说明DTD。
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

    看一下代码,标红处是为了解决标题所出现的报错的。标绿的地方主要是spring的版本问题,需要你找到对应自己版本即可。

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    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:mvc="http://www.springframework.org/schema/mvc"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
               http://www.springframework.org/schema/aop 
               http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-3.0.xsd
               http://cxf.apache.org/jaxws 
               http://cxf.apache.org/schemas/jaxws.xsd 
               http://www.springframework.org/schema/mvc
               http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
               http://www.springframework.org/schema/tx
               http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" default-autowire="byName">
  • 相关阅读:
    《Java从入门到放弃》入门篇:springMVC数据传递
    gets()、puts()函数。字符串函数。字符串排序的例子。
    请求上下文与应用上下文(12)
    flask之重定向(10)
    使用jsonify返回json数据(9)
    flask之返回的响应数据(8)
    flask之abort函数与自定义异常处理(7)
    flask获取请求参数(6)
    flask路由(5)
    flask创建app对象(4)
  • 原文地址:https://www.cnblogs.com/qcq0703/p/9040783.html
Copyright © 2011-2022 走看看