我知道这是一个非常基本的主题,但不幸的是我无法弄清楚为什么我会收到上述错误消息......我正在尝试生成一个简单的 HelloWorld Wicket 应用程序,但我不断收到一个 html 标记错误......
我的代码如下:
同学们好
package com.hello;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.WebPage;
public class Hello extends WebPage {
public Hello() {
add(new Label("message", "Hello Wicket World"));
}
}
你好.html
<!DOCTYPE html>
<html lang="en" xmlns:wicket="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Wicket World, szevasztok!</title>
</head>
<body>
<h1>
<span wicket:id="message">message comes here</span>
</h1>
</body>
</html>
MyApplication 类
package com;
import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;
import com.hello.Hello;
public class MyApplication extends WebApplication {
@Override
public Class<? extends Page> getHomePage() {
return Hello.class;
}
}
web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Wicket Web Application</display-name>
<filter>
<filter-name>wicket</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.MyApplication</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>wicket</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>wicket</groupId>
<artifactId>WicketExample</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>WicketExample</name>
<dependencies>
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket</artifactId>
<version>1.4.17</version>
</dependency>
<!-- slf4j-log4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>
</dependencies>
<build>
<finalName>WicketExample</finalName>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
<include>*</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<debug>true</debug>
</configuration>
</plugin>
</plugins>
</build>
</project>
我收到以下错误:
我已经用谷歌搜索了它,尝试了几次重构,但我一直得到相同的结果......
任何想法?
对不起这个非常基本的话题.... :(