Apache Click Framework --- 试用报告(一)
2010-03-09 16:26
239 查看
官方网址:http://click.apache.org/
感觉像是web版的swing,上手很快。对比框架有:Tapestry,Wicket等。
参考官网的资料,上一个最简单的例子先。
所需额外的lib:
click-2.1.0.jar
代码如下:
HelloWorld.java
click.xml
web.xml
hello-world.htm
运行tomcat访问:http://localhost:8080/Click/ 即可。
感觉像是web版的swing,上手很快。对比框架有:Tapestry,Wicket等。
参考官网的资料,上一个最简单的例子先。
所需额外的lib:
click-2.1.0.jar
代码如下:
HelloWorld.java
package examples.page; import java.util.Date; import org.apache.click.Page; public class HelloWorld extends Page { private static final long serialVersionUID = 1546524075423724069L; private Date time = new Date(); public HelloWorld() { addModel("time", time); } }
click.xml
<?xml version="1.0" encoding="UTF-8"?> <click-app> <pages package="examples.page"/> </click-app>
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" 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://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <servlet> <servlet-name>ClickServlet</servlet-name> <servlet-class>org.apache.click.ClickServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ClickServlet</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>hello-world.htm</welcome-file> </welcome-file-list> </web-app>
hello-world.htm
<html> <body> <h2>Hello World</h2> Hello world from Click at $time </body> </html>
运行tomcat访问:http://localhost:8080/Click/ 即可。
相关文章推荐
- framework7 vue touch事件 阻止click事件失效
- apache commons fileupload checkstyle报告(2016-07-01更新)
- GeneXus试用报告
- YARN : Architecture of Next Generation Apache Hadoop MapReduceFramework
- Apache类库之BeanUtils(一)-学习报告
- WEB打印新产品——Turbo ePrinting 试用报告(续1)
- iPhone专用谷歌手机语音搜索试用报告
- apache commons io checkstyle报告(2016-04-21更新)
- 10-建设单位试用报告
- python试用rest_framework写接口文件
- org.apache.catalina.connector.RequestFacade cannot be cast to org.springframework.web.multipart.Mult
- 试用报告心得
- Linux:Apache+MySQL+php+phpBB-实验报告
- Windows 10 中文技术预览版个人试用报告详细介绍
- apache_技术研究报告
- org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons
- 安装Apache Felix OSGI Framework小记
- 在solaris8 下安装apache2.26成功报告[原创]
- Apache Drill学习笔记一:环境搭建和简单试用
- [!] The 'Pods-lingfo' target has frameworks with conflicting names: ummobclick.framework.