Help
If you experience a problem, you can
- submit questions to:HTTL problem management
- participate QQ group: 184287288
- maillist: httl-user A googlegroups D com
- - subscribe: httl-user+subscribe A googlegroups D com
- - unsubscribe: httl-user+unsubscribe A googlegroups D com
- - online: https://groups.google.com/forum/#!forum/httl-user
member
creator (Founder)
- Liang Fei (Lynx - Platform Architecture Senior Technical Specialist) Hangzhou
- mail: liangfei0201 (At) gmail (Dot) com
- blog:http://javatar.iteye.com
- microblogging:http://weibo.com/liangfei0201
- contribution: frame design, engine implements, SPI implementation.
submitter (Committer)
- Li Ding (Aliyun - Alibaba PAAS Technical Specialist) Hangzhou
- mail: oldratlee (At) gmail (Dot) com
- blog:http://oldratlee.com
- microblogging:http://weibo.com/oldratlee
- contribution: Configure load, abnormal improvements, bug fixes.
contributors (Contributor)
- Li Fei (Long Hua - technical director) Xi'an
- mail: myaniu (At) gmail (Dot) com
- blog:http://my.oschina.net/myaniu/blog
- contribution: JFinal and HTTL integration:# 115
- Doudou Bear (Freeborders - Database Administrator) Chengdu
- mail: xwinie (At) gmail (Dot) com
- blog:http://my.oschina.net/xwinie/blog
- contribution: Nutz and HTTL integration:# 59
- mail: zqq_90 (At) 163 (Dot) com
- contribution: Type Bug Fixes:# 64
- contribution: Remove blank line command to achieve:# 89
user
collection, if you are using HTTL, welcome to provide company name ...
answers
Why use # setdeclare variable types?
mandatory declaration of variables # set definition, in order to clear the input template, which can strongly typed compiled improve performance.
also convenient template maintenance, weak type operators for long-term maintenance of Internet applications is extremely unfavorable, thousands of engineers tinkering with the template.
Who remembers what a object attributes, turn turn code documentation, someone changed an attribute of a object is not associated with, nor prompt.
even development IDE editor, can not automatically prompt nor error, such as run-time detection, it is affecting the efficiency of development.
Ali developed internally at a Velocity IDE editor encountered much resistance, have increased through the notes to the template type definition.
See:http://www.infoq.com/cn/articles/hk-semi -static-language
Howlike JSP custom tag functionality?
HTTL template to prevent complications and maintain the most simple instruction set, so do not allow users to extend the instruction set, and through the extension functions to achieve the same functionality.
custom tag:
extend it can be replaced with: # if (hasPrivilege ("foo")) ... # end
simply configure: import.methods + = com.your.YourPrivilegeStaticMethodClass
Compilation failedappear abnormal how do?
HTTL the compilation fails, it will automatically open-Xlint: unchecked parameter recompiled So users get the exception message, already contains detailed information JDK compiler failed.
If you analyze the reasonsno exception, HTTL simultaneously generated Java code will be printed in the log, You can copy the code out into the IDE, see the IDE error.
appear abnormal class or package not found how to do?
Please check httl, and you are using classes, whether in the classpath.
Please check import.packagespackage name is correct.
If JdkCompiler problems, you can try to change JavassistCompiler try to confirm whether the classpath for the JdkCompiler loading problems.
properties or methods can not find how to do?
If the following exception:
No such property xxx in class java.lang.Object
No such method xxx() in class java.lang.Object
is usually the type of the variable is not defined in the template, adding the variable type declaration: # set (Xxx xxx)
occur after the template change does not take effect how to do?
HTTL when it starts printing INFO log shows the loading configuration path, such as:
INFO: Load httl config from / home / foo / httl.properties in classpath.
you can look at your configuration is the log of the share on the print position to avoid multiple copies httl.properties configuration, loaded the wrong configuration file.
If you have multiple copies of configuration, HTTL WARN log will be printed to alert the user, such as:
WARN: Multi httl config in classpath, conflict configs: [/ home / foo / httl.properties, / home / foo / conf / httl.properties]. Please keep only one config.
And, HTTL first template is loaded, it will print the template INFO log shows where the absolute path, such as:
INFO: Load httl template from RELOADABLE directory / home / foo / templates by ClasspathLoader.
you can look at your template is printed in the log template directory, avoid modifying templates does not load the directory, where the thermal load on RELOADABLE represents, in the absence of open heat loads to modify the template requires rebooting.
template rendering garbled how to do?
If garbled, check HTTL encoding configuration:
input.encoding = UTF-8
output.encoding = UTF-8
default values are file.encoding, namely the local operating system file encoding.
addition, MVC integration, the default value will output.encoding write response.setEncodingCharset() in,
Of course, you can also configure response.encoding = null turn off the automatic response encoding settings,
If OutputStream output template, please make sure response.encoding and output.encoding consistent, otherwise the output will be garbled.
Please note, input.encoding refers loaded from disk template coding, and request.getEncodingCharset not related, you can use a different encoding.
command name and text phase how to do?
such as: # elseTEXT, separated by brackets available with no parameters, such as: # if (x) AAA # else() BBB # end() CCC
$ {} placeholders can nest?
HTTL does not support nested placeholders, such as: $ {include ("$ {dir} / file")}, placeholder stitching with a plus sign inside your string, such as: $ {include (dir +" / file")}
involved
participation
you cangithub pullyour changes to us.
You can also directlycode, send us an email: liangfei0201 (At) gmail (Dot) com
participate Content
Documentation Additions
If you find a missing document, or the answer had FAQ, use the experience, as well as your understanding of the details, you can send e-mail to us, we will be posted on this site for others to share their knowledge.
Template Test
you can help test more scenarios template, simply provide test documentation templates and expected results can, such as:
existing test template:src / test / resources / comment / templates
existing test results:src / test / resources / comment / results
can run httl.test.TemplateTest test class, it will automatically scan and implementation templates of all templates, and use results under the same name plus. txt suffix to the output file contents assertions.
fixes
You can help fixgithub issueson the issue.
core improvements
If you are interested to spend more time to participate HTTL, and have some development capabilities can be added to the core of the improvements:
- interpreted and compiled execution before the automatic switch, similar to the JVM JIT.
- complete generic derivation, and Java generics derive the same.
- generate bytecode optimization details, such as reducing instanceof, reduce reflection and reduce packing.
- exception friendly tips, such as run-time operations error, suggesting that the position in the template.
- in the thermal loading, unloading support compiled before template class.
- bytecode support disk cache, reducing the restart compilation.
- reconstruction AST tree, so that can be extended.
extension implementation
You can also implementHTTL extension point, including:
- Static, static methods
- Loader, load the template
- Resolver, variable decision
- Formatter, output format
- Filter, output filters
- Converter, rendering parameters Conversion
- Interceptor, the rendering process to intercept
- Listener, the rendering process monitoring
framework integration
You can also help integrate various MVC framework, as well as other scenes need to use a template.
aids
You can also help achieve Eclipse, IDEA and other template development plug-ins, and Debug debugging, test viewer and so on.