文档注释以斜线后紧跟两个星号(/**)开始,以星号后紧跟一个斜线(*/)作为结尾,中间部分全部都是文档注释,会被提取到API文档中。
自行搜索一下javadoc即可,示例如下:
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
/**
* 类描述
*
* @author 作者
* @version 版本
*/
public class DemoClass {
/**
* 内部属性:name
*/
private String name
/**
* Setter方法
* @return name
*/
public String getName() {
return name
}
/**
* Getter方法
* @param name
*/
public void setName(String name) {
this.name = name
}
}
ftl不可以和jsp共存的,二者具有转化关系。freemarker(FTL)常见语法(JSP中的代码转化为ftl代码) 举例如下:
1、引入公共页面<#include "params.ftl">
2、判断是否为空:<#if (resultContext.pagination.resultList)?? &&resultContext.pagination.resultList?size gt 0>
3、集合遍历:
<#list list as a>
${a_index+1}
</#list>
4、访问Java类中的静态方法
<#if st == stack.findValue("@com.test.bo.SkuTag@NEW")><#elseif st == stack.findValue("@com.test.bo.SkuTag@SPECIAL") >
5、访问Request对象
${Request.effectType.infoName!'' } 其他域对象比如:Session对象 貌似还是是${Session.*****}
6、使用其他标签如struts2标签:
引入tld:<#assign ts=JspTaglibs["/skw-tags"] /> 使用: [email protected] loginUrl="${ctxtPath}/login_jsp.html"/>