配置web.xml中的 Invalid content was found starting with element 'init-param'.错误
来源:互联网 发布:澄海美工招聘 编辑:程序博客网 时间:2024/06/17 03:10
今天在搭建springmvc框架时,需要配置web.xml中的DispatcherServlet
初始化代码如下
<servlet> <servlet-name>chapter</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/config/spring/chapter-servlet.xml</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>chapter</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
其中的
<init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/config/spring/chapter-servlet.xml</param-value> </init-param>负责初始化配置文件, 默认为/WEB-INF/$servlet-name$-servlet.xml
没想到打上去之后出现
Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":enabled, "http://java.sun.com/xml/ns/javaee":async- supported, "http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/ javaee":security-role-ref, "http://java.sun.com/xml/ns/javaee":multipart-config}' is expected.
错误,错误原因为
根元素<web-app>中的模式文件不对,javaee只支持单个的config,要换成 j2ee即将模式文件
"http://java.sun.com/xml/ns/javaee"改成"http://java.sun.com/xml/ns/j2ee"亲测不报错
阅读全文
0 0
- 配置web.xml中的 Invalid content was found starting with element 'init-param'.错误
- servlet的init-param错误 Invalid content was found starting with element 'init-param'.
- spring Invalid content was found starting with element 'init- param'
- spring Invalid content was found starting with element 'init- param'
- cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'.
- cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'.
- nvalid content was found starting with element 'init-param'.
- vc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http:
- Invalid content was found starting with element 'taglib'错误 .
- eclipse 中web.xml错误:cvc-complex-type.2.4.a: Invalid content was found starting with element
- 【记录】MyEclipse下web.xml报错Invalid content was found starting with element 'display-name'
- eclipse validator - Invalid content was found starting with element 'display-name' in web.xml
- web项目web.xml出现cvc-complex-type.2.4.a: Invalid content was found starting with element
- 解决XML中报“cvc-complex-type.2.4.a: Invalid content was found starting with element ”错误
- web.xml 报错cvc-complex-type.2.4.a: Invalid content was found starting with element 'cookie-config'...
- Web.xml配置<taglib>标签报错问题(cvc-complex-type.2.4.a: Invalid content was found starting with element 'tag
- ActiveMQ Invalid content was found starting with element
- Invalid content was found starting with element 'taglib'”
- Java反射机制及IoC原理
- java 发送邮件
- SQL新手新手向入门修炼(1)
- TFTP与NFS服务器配置
- Linux基础命令
- 配置web.xml中的 Invalid content was found starting with element 'init-param'.错误
- Linux中常见的命令以及Linux的目录结构
- web测试方法总结(一)
- C#之HttpWebRequest
- STM32CUBEMX_STM32F030F4P6_TIM1_CH3_PWM
- 1微机原理
- CRC8查表法中表的计算过程
- UART串行通信
- 背景图片不被拉伸方案及设置图片透明效果