java web mvc-04-Apache Wicket

拓展阅读

Spring Web MVC-00-重学 mvc

mvc-01-Model-View-Controller 概览

web mvc-03-JFinal

web mvc-04-Apache Wicket

web mvc-05-JSF JavaServer Faces

web mvc-06-play framework intro

web mvc-07-Vaadin

web mvc-08-Grails

开源

The jdbc pool for java.(java 手写 jdbc 数据库连接池实现)
The simple mybatis.(手写简易版 mybatis)

Apache Wicket

Apache Wicket 为全球的网站和应用服务了十多年。有了这个版本,Wicket完全支持Java 8的习惯用法,允许在所有合适的地方使用lambda表达式。

使用Wicket 8,您可以编写更少、更快、更易于维护的代码。

快速开始

依赖

  • maven

生成命令

mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=8.0.0 -DgroupId=com.github.houbb -DartifactId=wicket -DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false

将会生成一个 maven 项目

项目结构

.
├── pom.xml
└── src
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── github
    │   │           └── houbb
    │   │               ├── HomePage.html
    │   │               ├── HomePage.java
    │   │               └── WicketApplication.java
    │   ├── resources
    │   └── webapp
    │       ├── WEB-INF
    │       │   └── web.xml
    │       ├── logo.png
    │       └── style.css
    └── test
        ├── java
        │   └── com
        │       └── github
        │           └── houbb
        │               ├── Start.java
        │               └── TestHomePage.java
        ├── jetty
        │   ├── jetty-http.xml
        │   ├── jetty-https.xml
        │   ├── jetty-ssl.xml
        │   └── jetty.xml
        └── resources
            └── keystore

运行项目

  • 运行日志

运行 Start.main() 方法启动日志如下

SSL access to the examples has been enabled on port 8443
You can access the application using SSL on https://localhost:8443

[main] INFO org.eclipse.jetty.server.Server - jetty-9.4.7.v20170914
[main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
[main] INFO org.eclipse.jetty.server.session - DefaultSessionIdManager workerName=node0
[main] INFO org.eclipse.jetty.server.session - No SessionScavenger set, using defaults
[main] INFO org.eclipse.jetty.server.session - Scavenging every 660000ms
[main] INFO org.apache.wicket.util.file.WebXmlFile - web.xml: url mapping found for filter with name wicket.wicket: [/*]
[main] INFO org.apache.wicket.Application - [wicket.wicket] init: Wicket core library initializer
[main] INFO org.apache.wicket.protocol.http.WebApplication - [wicket.wicket] Started Wicket version 8.0.0 in DEVELOPMENT mode
********************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.              ***
***                               ^^^^^^^^^^^                    ***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** See Application#getConfigurationType() for more information. ***
********************************************************************
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.w.WebAppContext@9f70c54{/,file:///Users/houbinbin/code/_third/wicket/src/main/webapp/,AVAILABLE}{src/main/webapp}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@366e2eef{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[main] INFO org.eclipse.jetty.util.ssl.SslContextFactory - x509=X509@61230f6a(jetty,h=[],w=[]) for SslContextFactory@49d904ec(file:///Users/houbinbin/code/_third/wicket/target/test-classes/keystore,null)
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@2096442d{SSL,[ssl, http/1.1]}{0.0.0.0:8443}
[main] INFO org.eclipse.jetty.server.Server - Started @1438ms
[qtp824318946-25] WARN org.eclipse.jetty.http.HttpParser - Illegal character 0x16 in state=START for buffer HeapByteBuffer@fb1dbe6[p=1,l=517,c=8192,r=516]={\x16<<<\x03\x01\x02\x00\x01\x00\x01\xFc\x03\x03\xC5w\xAby\xA6 \x90...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
[qtp824318946-18] WARN org.eclipse.jetty.http.HttpParser - Illegal character 0x16 in state=START for buffer HeapByteBuffer@2f847c8[p=1,l=517,c=8192,r=516]=
....

访问

直接访问即可 http://localhost:8080/

相关推荐
论迹9 分钟前
【JavaEE】-- 多线程(初阶)2
java·开发语言·java-ee
桃子是唯一的水果17 分钟前
java 单例模式(Lazy Initialization)实现遍历文件夹下所有excel文件且返回其运行时间
java·单例模式·maven
+72019 分钟前
如何在java中用httpclient实现rpc post 请求
java·开发语言·rpc
ybq1951334543121 分钟前
javaEE-SpringBoot日志
java·spring boot·后端
火烧屁屁啦24 分钟前
【JavaEE进阶】图书管理系统 - 贰
java·spring
xzzd_jokelin25 分钟前
Spring AI 接入 DeepSeek:开启智能应用的新篇章
java·人工智能·spring·ai·大模型·rag·deepseek
m0_7482382730 分钟前
项目升级Sass版本或升级Element Plus版本遇到的问题
前端·rust·sass
刘什么洋啊Zz36 分钟前
剖析IO原理和零拷贝机制
java·运维·网络
卷心菜好6啊43 分钟前
特辣的海藻!2
java
心态与习惯1 小时前
mac 下 java 调用 gurobi 不能加载 jar
java·jar·mac·cplex·gurobi