码迷,mamicode.com
首页 > 编程语言 > 详细

httl开源JAVA模板引擎,动态HTML页面输出

时间:2015-09-23 06:40:38      阅读:1696      评论:0      收藏:0      [点我收藏+]

标签:

HTTL(Hyper-Text Template Language)是一个适用于HTML输出的开源JAVA模板引擎,适用于动态HTML页面输出,可用于替代JSP页面,它的指令类似于Velocity。
HTTL采用类似于JSP的原理,将模板编译成Java字节码运行,但比JSP的EL更进一步,使用强类型推导,减少运行期反射和转型,更加快速.

缺省配置下,HTTL不需要依赖任何三方类库即可运行。

  二进制包 源代码包 源码仓库
HTTL核心包 httl-1.0.11.jar httl-1.0.11-sources.jar httl-1.0.11
Script集成包 httl-script-1.0.11.jar httl-script-1.0.11-sources.jar httl-script-1.0.11
Servlet集成包 httl-servlet-1.0.11.jar httl-servlet-1.0.11-sources.jar httl-servlet-1.0.11
SpringMVC集成包 httl-springmvc-1.0.11.jar httl-springmvc-1.0.11-sources.jar httl-springmvc-1.0.11
Struts集成包 httl-struts-1.0.11.jar httl-struts-1.0.11-sources.jar httl-struts-1.0.11
WebX集成包 httl-webx-1.0.11.jar httl-webx-1.0.11-sources.jar httl-webx-1.0.11
JFinal集成包 httl-jfinal-1.0.11.jar httl-jfinal-1.0.11-sources.jar httl-jfinal-1.0.11
Nutz集成包 httl-nutz-1.0.11.jar httl-nutz-1.0.11-sources.jar httl-nutz-1.0.11
  二进制包 源代码包 源码仓库
Servlet示例 httl-servlet-demo-1.0.11.war httl-servlet-demo-1.0.11.zip httl-servlet-demo-1.0.11
SpringMVC示例 httl-springmvc-demo-1.0.11.war httl-springmvc-demo-1.0.11.zip httl-springmvc-demo-1.0.11
Struts示例 httl-struts-demo-1.0.11.war httl-struts-demo-1.0.11.zip httl-struts-demo-1.0.11
JFinal示例 httl-jfinal-demo-1.0.11.war httl-jfinal-demo-1.0.11.zip httl-jfinal-demo-1.0.11
Nutz示例 httl-nutz-demo-1.0.11.war httl-nutz-demo-1.0.11.zip httl-nutz-demo-1.0.11

Maven依赖

已发布到Maven中央库:http://central.maven.org/maven2/com/github/httl/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<project>
    <dependencies>
        <dependency>
            <groupId>com.github.httl</groupId>
            <artifactId>httl</artifactId>
            <version>1.0.11</version>
        </dependency>
        <!--
        <dependency>
            <groupId>com.github.httl</groupId>
            <artifactId>httl-script</artifactId>
            <version>1.0.11</version>
        </dependency>
        <dependency>
            <groupId>com.github.httl</groupId>
            <artifactId>httl-servlet</artifactId>
            <version>1.0.11</version>
        </dependency>
        <dependency>
            <groupId>com.github.httl</groupId>
            <artifactId>httl-springmvc</artifactId>
            <version>1.0.11</version>
        </dependency>
        <dependency>
            <groupId>com.github.httl</groupId>
            <artifactId>httl-struts</artifactId>
            <version>1.0.11</version>
        </dependency>
        <dependency>
            <groupId>com.github.httl</groupId>
            <artifactId>httl-webx</artifactId>
            <version>1.0.11</version>
        </dependency>
        <dependency>
            <groupId>com.github.httl</groupId>
            <artifactId>httl-jfinal</artifactId>
            <version>1.0.11</version>
        </dependency>
        <dependency>
            <groupId>com.github.httl</groupId>
            <artifactId>httl-nutz</artifactId>
            <version>1.0.11</version>
        </dependency>
        -->
    </dependencies>
<project>

运行示例

将war包放到:tomcat/webapps/httl-springmvc-demo-1.0.11.war,并启动tomcat,
然后访问:http://localhost:8080/httl-springmvc-demo-1.0.11

源代仓库

可以用同样的方式,导入MVC集成示例源码。

下载主干源码:

1
2

或者,直接下载各版本Tag包,并解压:

1
2
3
unzip httl-1.0.11.zip -d httl-1.0.11
cd httl-1.0.11

编译源码:

1
mvn install -Dmaven.test.skip

生成Eclipse工程描述文件:

1
mvn eclipse:eclipse -DdownloadSources

导入Eclipse工程:

Eclipse -> File -> Import -> Existing Projects into Workspace -> Browse -> Finished

将.httl文件以html编辑器格式打开:

Eclipse -> Window -> Preferences -> General -> Content Types -> Text -> HTML -> Add -> *.httl

安装Maven命令行:(用于支持上面的mvn命令)

Linux:

1
2
3
tar zxvf apache-maven-2.2.1-bin.tar.gz
export PATH=$PATH:apache-maven-2.2.1/bin

Windows:

 

1
2
3
解压 apache-maven-2.2.1-bin.tar.gz
桌面 -> 我的电脑 -> 右键菜单 -> 系统属性 -> 高级 -> 环境变量 -> 在PATH变量中加入apache-maven-2.2.1/bin目录。

httl开源JAVA模板引擎,动态HTML页面输出

标签:

原文地址:http://www.cnblogs.com/timdes/p/4831081.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!