java动态模板HTML,HTML.Template.java

HTML.Template 是一个用于 Java 的动态模板库,它允许你在 HTML 文件中插入变量和控制结构,从而将设计与编程逻辑分离。模板文件保持为纯 HTML,仅包含特殊标签来表示动态内容。这个库旨在简化 HTML 设计师与 Java 开发者之间的合作,实现跨语言模板的互操作性,与 Perl 的 HTML::Template 模块兼容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

HTML.Template version 0.1.2 - 9 October 2002

HTML.Template aims to do to java what HTML::Template.pm did to perl.

HTML.Template makes it possible to use HTML Templates inside your java

code. You no longer need to recompile your servlets everytime you

change the HTML.

Your templates are normal HTML files with a few extra tags where variable

content goes. The Template module replaces these tags with values specified

through your program, and displays the combined document.

See the Howto for information and sample code to

use templates in your java programs.

This package is intended to make it easy for a HTML designer to develop

templates to be used in conjunction with your java code. Many a time

the person developing the application, and the person designing the look

aren't the same. The designer knows nothing about programming, and although

as developers we'd like to think that we are good designers, the fact is that

many of us aren't.

HTML.Template, like its perl counterpart, extends HTML with a few HTML like

tags - , , , ,

and . The file written with HTML and these

new tags is called a template. Using the HTML.Template class, you fill in the

values for the variables, loops and branches declared in the template.

What differentiates HTML.Template from other templating solutions is that is

enforces a strict distinction between logic and layout. A template cannot

contain programming logic (except from the branches and loops).

A second point worth noting, is that using HTML.Template for java and HTML::Template

for perl means that your templates are interoperable across two languages.

'The first cross-language templating standard', as Jesse Erlbaum would put it :).

Acknowledgements

Thanks go to Sam Tregar, the developer of the HTML::Template perl module, for

writing that most excellent module that I use for everything, and for sticking

firm to the principle of not allowing programming logic into templates.

I'd also like to thank Sam for allowing me to use the code examples from the perl

module in the documentation for this module. Those familiar with the docs of

HTML::Template will notice a lot in common in the overall documentation.

If you're planning of writing perl code that may require templates, have a look

at Sam's Module. The link is on the left (at the top if your browser doesn't

fully support stylesheets).

Thanks also to the chaps on the htmltmpl mailing list for keeping the discussions

lively.

Copyright

This package is Copyright (c) 2002 Philip S Tellis (philip.tellis At gmail.com).

Distribution is under the terms Artistic or GNU General Public Licence.

Licence

This module is free software; you can redistribute it

and/or modify it under the terms of either:

the GNU General Public License as published

by the Free Software Foundation; either version 1, or (at your option)

any later version, or

the "Artistic License" which comes with

this module.

You should have received a copy of the Artistic License

with this module, in the file Artistic.txt.

If not, I'll be glad to provide one.

You should have received a copy of the GNU General Public

License along with this program; if not, write to the Free

Software Foundation, Inc., 59 Temple Place, Suite 330,

Boston, MA 02111-1307 USA

Warranty

This program is distributed in the hope that it will be

useful, but WITHOUT ANY WARRANTY; without even the implied

warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR

PURPOSE. See either the GNU General Public License or the

Artistic License for more details.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值