【发布时间】:2018-10-13 03:28:22
【问题描述】:
在 Windows 10 上安装 Apache Wicket 8.0.0-M8 之前从未使用过 Wicket。我还安装了 apache-tomcat-9.0.7。
我将以下 Tomcat conf 文件夹文件替换为 wicket 提供的文件:
context.xml、server.xml
我使用 Eclipse Neon 的 Maven 选项创建了一个名为 myproject 的项目。 Eclipse 生成了以下 web.xml 文件,我将其重新定位到:
<TOMCAT_HOME>\webapps\myproject\WEB-INF
That web.xml file looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<display-name>myproject</display-name>
<!--
There are three means to configure Wickets configuration mode and they
are tested in the order given.
1) A system property: -Dwicket.configuration
2) servlet specific <init-param>
3) context specific <context-param>
The value might be either "development" (reloading when templates change) or
"deployment". If no configuration is found, "development" is the default. -->
<filter>
<filter-name>wicket.myproject</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.quantech.myproject.WicketApplication</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>wicket.myproject</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Eclipse 发现此文件存在以下问题:
- 引用的文件包含错误 (http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_3_1.xsd)。 web.xml /myproject/src/main/webapp/WEB-INF 第 1 行 XML 问题
TargetNamespace.1:需要命名空间“http://java.sun.com/xml/ns/javaee”,但架构文档的目标命名空间是“http://xmlns.jcp.org/xml/ns/javaee”。
当我将 web.xml 加载到 XMLSpy 中时,我收到消息:
此文件无效。 DTD/Schema 中未定义根元素“web-app”。
有人知道这里出了什么问题吗?
谢谢,
特里
【问题讨论】: