在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发现此文件存在以下问题:
TargetNamespace.1:期望命名空间&#39; http://java.sun.com/xml/ns/javaee&#39;,但架构文档的目标命名空间是&#39; http://xmlns.jcp.org/xml/ns/javaee&#39;。
当我将web.xml加载到XMLSpy时,我收到消息:
此文件无效。根元素&#39; web-app&#39;未在DTD / Schema中定义。
任何人都知道这里有什么问题吗?
感谢,
特里
答案 0 :(得分:1)
I replaced the following Tomcat conf folder files with those provided by wicket:
context.xml, server.xml
Wicket不提供此类文件!
Eclipse generated the following web.xml file
Eclipse found the following problems with this file:
糟糕的日食! 只需忽略这些错误/警告。 Tomcat不会抱怨。 为了让Eclipse开心,您将调整其配置。虽然我无法帮助你。我使用不同的IDE。