package com.chenhailong;
import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;
/**
* @author dnc
*
*/
public class NavomaticApplication extends WebApplication {
public NavomaticApplication() {
}
public Class<? extends Page> getHomePage() {
return Page1.class;
}
}
这部分是添加Border的
package com.chenhailong;
import org.apache.wicket.markup.html.border.Border;
import org.apache.wicket.markup.html.border.BoxBorder;
/**
* Border component.
*
* @author Jonathan Locke
*/
public class NavomaticBorder extends Border
{
/**
*
*/
private static final long serialVersionUID = -6423351173280123140L;
/**
* Constructor
*
* @param id
* The id of this component
*/
public NavomaticBorder(final String id)
{
super(id);
addToBorder(new BoxBorder("navigationBorder"));
addToBorder(new BoxBorder("bodyBorder"));
}
}
这部分是Page1
package com.chenhailong;
import org.apache.wicket.markup.html.WebPage;
/**
*
* @author dnc
*
*/
public class Page1 extends WebPage {
/**
*
*/
private static final long serialVersionUID = -9074590581491134925L;
public Page1() {
add(new NavomaticBorder("navomaticBorder"));
}
}
这部分是Page2
package com.chenhailong;
import org.apache.wicket.markup.html.WebPage;
/**
*
* @author dnc
*
*/
public class Page2 extends WebPage {
/**
*
*/
private static final long serialVersionUID = -5860215264527824313L;
public Page2() {
add(new NavomaticBorder("navomaticBorder"));
}
}
这部分是Page3
package com.chenhailong;
import org.apache.wicket.markup.html.WebPage;
/**
*
* @author dnc
*
*/
public class Page3 extends WebPage {
/**
*
*/
private static final long serialVersionUID = -8240473175664633261L;
public Page3() {
add(new NavomaticBorder("navomaticBorder"));
}
}
<html xmlns:wicket="http://wicket.apache.org">
<head>
<title>Wicket Examples</title>
</head>
<body>
<wicket:border>
<p>
<table height="100%">
<tr>
<td height="100%" valign="top">
<div wicket:id="navigationBorder"><b>Navigation Links</b>
<p><wicket:link>
<a href="Page1.html">Page1</a>
<br />
<a href="Page2.html">Page2</a>
<br />
<a href="Page3.html">Page3</a>
</wicket:link></p>
</div>
</td>
<td valign="top"><span wicket:id="bodyBorder"> <wicket:body />
</span></td>
</tr>
</table>
</p>
</wicket:border>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>Insert title here</title>
</head>
<body>
<div wicket:id="navomaticBorder"><b>This is test for the
wicket.
</b>
<pre>
public class Page1 extends WebPage {
public Page1() {
add(new NavomaticBorder("navomaticBorder"));
}
}
</pre>
<wicket:link>
<a href="Page2.html">Page2</a>
</wicket:link>
<font color="Yellow">It is the code of Page1.java</font></div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>Insert title here</title>
</head>
<body>
<div wicket:id="navomaticBorder">
<b>This is test for the wicket.</b>
<pre>
public class Page2 extends WebPage {
public Page2() {
add(new NavomaticBorder("navomaticBorder"));
}
</pre>
<wicket:link>
<a href="Page3.html">Page3</a>
</wicket:link>
<font color="Blue">It is the code of Page2.java</font>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>Insert title here</title>
</head>
<body>
<div wicket:id="navomaticBorder">
<b>This is test for the wicket.</b>
<p>
<pre>
public class Page3 extends WebPage {
public Page3() {
add(new NavomaticBorder("navomaticBorder"));
}
}
</pre>
</p>
<wicket:link>
<a href="Page1.html">Page1</a>
</wicket:link>
<font color="Red">It is the code of Page3.java</font>
</div>
</body>
</html>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Wicket Examples</display-name>
<servlet>
<servlet-name>NavomaticApplication</servlet-name>
<servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.chenhailong.NavomaticApplication</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>NavomaticApplication</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
</web-app>
分享到:
相关推荐
Apache Wicket Cookbook
Using wicket:message to output localized markup 86 Overriding localized resources on a case by case basis 89 ii Table of Contents Chapter 5: Displaying Data Using DataTable 95 Introduction 95 ...
Wicket has been around since 2004 and it has been an Apache project since 2007. During these years it has proved to be a solid and valuable solution for building enterprise web applications. Wicket ...
apache wicket cookbook 包含最新的12章
this guide is based on Wicket 6. However if you are using an older version you should find this guide useful as well, but it's likely that the code and the snippets won't work with your version.
本文档演示了如何获取、构建和部署 Apache Fortress Wicket 示例应用程序。 要完成本教程,请首先按照本 README 中的步骤进行操作。 接下来是这里的步骤: 先决条件 Java 8++ Apache Maven 3++ Apache Tomcat ...
apache-wicket-7 the most instertst skill
什么是Apache Wicket? Apache Wicket是一个开源的,基于Java,基于组件的Web应用程序框架。 通过适当的标记/逻辑分离,POJO数据模型以及令人耳目一新的XML缺乏,Apache Wicket使开发Web应用程序变得简单而又愉快。...
Apache Wicket 是创新型 Java Web 应用程序框架。它通过彻底地分离开发人员与设计人员的角色,帮助简化 Web 应用程序开发。它将允许您从视图层中删除逻辑代码,消除使用 JavaServer Page (JSP) 的需求,提供以简单...
wicket-presentation:Apache Wicket演示文稿的源代码
apache-wicket-1.5.11.zip 里面有jar包和api
Apache_Wicket_User_Guide_Reference_Documentation 英文版
检票口评价Apache Wicket 评估应用要求JDK Maven克隆存储库并下载并安装 Java 和 Maven。 然后只需运行mvn jetty:run now 应用程序应该可以在3d派对Mockito、Spring 和 Apache Wicket 的集成基于( )。 ...
创建并扩展Apache_Wicket_Web应用.doc
wicket 库文件,一个很好的web框架
“ wicket组件”项目是apache wicket网络框架的组件库。 wicket组件引用了桌面应用程序的经典组件库(例如Microsoft Foundation Classes,QT Library或wxWindows),为wicket Web应用程序提供了图形用户界面组件。 ...
小胡子提供一个专门的面板和一些相关的实用程序,使用户能够使用 Mustache 和 Apache Wicket。 当前构建状态: wicket-mustache取决于 。 文档:通过所有mustache模空白差异添加maven依赖: < dependency> ...