web.xml配置文件中<async-supported>true</async-supported>报错的解决方案
来源:互联网 发布:维基百科数据 编辑:程序博客网 时间:2024/06/01 08:28
在写web.xml的时候又一次总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误,还出现小红叉,在网上找了很多,有说是把报红叉的代码写在<jsp-config></jsp-config>之间,试了之后发现完全没用。
后来在外文网站上找到了一个方法就把问题解决了
解决方法一:
在eclipse中配置xml
1、 http://www.springmodules.org/schema/cache/springmodules-cache.xsd
2、http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd
然后再将这两个xsd加入到web.xml中就搞定了 ,如下面代码:
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <!--OS Work Flow -->
- <display-name>OSWorkflow Example App</display-name>
- <description>OSWorkflow Example App</description>
- <servlet>
- <servlet-name>SOAPWorkflow</servlet-name>
- <servlet-class>
- com.opensymphony.workflow.soap.SOAPWorkflowServlet
- </servlet-class>
- </servlet>
- <servlet>
- <description>
- This is the description of my J2EE component
- </description>
- <display-name>
- This is the display name of my J2EE component
- </display-name>
- <servlet-name>Osworkflow</servlet-name>
- <servlet-class>net.caiban.servlet.Osworkflow</servlet-class>
- </servlet>
- <servlet>
- <description>
- This is the description of my J2EE component
- </description>
- <display-name>
- This is the display name of my J2EE component
- </display-name>
- <servlet-name>DoWorkflow</servlet-name>
- <servlet-class>net.caiban.servlet.DoWorkflow</servlet-class>
- </servlet>
- <servlet>
- <description>
- This is the description of my J2EE component
- </description>
- <display-name>
- This is the display name of my J2EE component
- </display-name>
- <servlet-name>CreateWorkflow</servlet-name>
- <servlet-class>net.caiban.servlet.CreateWorkflow</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>SOAPWorkflow</servlet-name>
- <url-pattern>/soap/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Osworkflow</servlet-name>
- <url-pattern>/servlet/Osworkflow</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>DoWorkflow</servlet-name>
- <url-pattern>/servlet/DoWorkflow</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>CreateWorkflow</servlet-name>
- <url-pattern>/servlet/CreateWorkflow</url-pattern>
- </servlet-mapping>
- <welcome-file-list>
- <welcome-file>default.jsp</welcome-file>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
- <resource-ref>
- <res-ref-name>jdbc/oswf</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <init-param driverClassName="com.mysql.jdbc.Driver" />
- <init-param url="jdbc:mysql://localhost:3306/osworkflow" />
- <init-param user="root" />
- <init-param password="123465" />
- <init-param max-connections="20" />
- <init-param max-idle-time="30" />
- </resource-ref>
- <!--OS Work Flow -->
- </web-app>
解决方法二:
<async-supported>true</async-supported>是web.xml 3.0的新特性,只需将
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
改成:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
即可解决。
- web.xml配置文件中<async-supported>true</async-supported>报错的解决方案
- web.xml配置文件中<async-supported>true</async-supported>报错的解决方案
- web.xml配置文件中<async-supported>true</async-supported>报错的解决方案
- web.xml配置文件中<async-supported>true</async-supported>报错的解决方案
- web.xml配置文件中<async-supported>true</async-supported>报错的解决方案
- web.xml配置文件中<async-supported>true</async-supported>报错的解决方案
- web.xml中<async-supported>true</async-supported>报错
- web.xml报错<async-supported>true</async-supported>
- web.xml <async-supported>true</async-supported>报错
- web.xml中<async-supported>报错异常
- web.xml(2.5)中配置<async-supported>报错的解决办法
- web.xml <async-supported>标签报错解决方法
- web 文件报错之async-supported
- 解决正确配置Servlet async-supported参数报错问题
- SpringMVC项目中使用 spring security时<async-supported>报错
- 报错cvc-complex-type.2.4.a: Invalid content was found starting with element 'async-supported'
- Async pixel transfers not supported 和 Undefined
- ajax中async true/false的作用
- 流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls)
- 聂树斌案类似案件-呼格吉勒图案
- jQuery插件:跨浏览器复制jQuery-zclip
- 解决Eclipse,MyEclipse出现An error has occurred,See error log for more details的错误
- 仿照Iterator写的一个迭代器
- web.xml配置文件中<async-supported>true</async-supported>报错的解决方案
- 软件管理
- 【算法概论】4.图中的路径
- media query
- QT开发之XML(SAX接口)
- 运动规划最全简介
- VC控件的子类化
- java实现对一个字符串中的数值进行从小到大的排序
- 旋转数组的最小数字