Wicket 8 пример web.xml myproject - PullRequest
0 голосов
/ 03 мая 2018

Никогда не использовал Wicket до того, как я установил Apache Wicket 8.0.0-M8 в Windows 10. Я также установил apache-tomcat-9.0.7.

Я заменил следующие файлы папки Tomcat Conf на файлы, предоставленные wicket:

context.xml, server.xml

Я использовал опцию Eclipse Neon's 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, я получаю сообщение:

Этот файл недействителен. Корневой элемент "web-app" не определен в DTD / Schema.

Кто-нибудь знает, что здесь не так?

спасибо,

Терри

1 Ответ

0 голосов
/ 03 мая 2018
 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:

Bad Eclipse! Просто игнорируйте эти ошибки / предупреждения. Tomcat не будет жаловаться. Чтобы сделать Eclipse счастливым, вам нужно настроить его. Я не могу помочь вам с этим, хотя Я использую разные IDE.

...