java jetx_jetbrick,新一代 Java 模板引擎,具有高性能和高扩展性

jetbrick-template 是一个新一代 Java 模板引擎,具有高性能和高扩展性。 适合于动态 HTML 页面输出或者代码生成,可替代 JSP 页面或者 Velocity 等模板。 指令和 Velocity 相似,表达式和 Java 保持一致,易学易用。

文章最后附简单springmvc集成jetbrick.template模版项目一个。

1.配置web.xml<?xml version="1.0" encoding="UTF-8"?>

http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"version="3.0">

jetbrick-template-config-location

/WEB-INF/jetbrick-template.properties

jetbrick.template.web.JetWebEngineLoader

mvc

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:spring-mvc.xml

1

mvc

/*

index.html

二、spring-mvc.xml配置

三、jetbrick-template.properties配置

import.packages = jetbrick.template.samples.dao, jetbrick.template.samples.model

import.autoscan = true

import.autoscan.packages = jetbrick.template.samples

template.reloadable = true

compile.debug = true

input.encoding=UTF-8

output.encoding=UTF-8

template.path=/WEB-INF/jetx/

template.loader=jetbrick.template.resource.loader.FileSystemResourceLoader

template.suffix=.jetx

四、使用

jetbrick-template samples
Welcome, You are ${author.name}!
ID书名作者价格出版时间#for(BookInfo book: author.getBooks())${book.id}${book.name}${book.getAuthorUser().name}${book.price.format()}${book.publicationDate.format("yyyy-MM-dd")}#else

Sorry! 还没出版过任何数据哦!

#end


点击这里返回用户列表#include("includes/footer.jetx")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值