【问题标题】:Wicket 8 web.xml myproject exampleWicket 8 web.xml myproject 示例
【发布时间】: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 发现此文件存在以下问题:

TargetNamespace.1:需要命名空间“http://java.sun.com/xml/ns/javaee”,但架构文档的目标命名空间是“http://xmlns.jcp.org/xml/ns/javaee”。

当我将 web.xml 加载到 XMLSpy 中时,我收到消息:

此文件无效。 DTD/Schema 中未定义根元素“web-app”。

有人知道这里出了什么问题吗?

谢谢,

特里

【问题讨论】:

    标签: apache wicket web.xml


    【解决方案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。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-13
      • 2017-06-18
      • 1970-01-01
      • 2019-12-29
      • 1970-01-01
      • 1970-01-01
      • 2016-01-09
      • 1970-01-01
      相关资源
      最近更新 更多