在页面中遍历一个list,现有个需求想在第五条的时候加个line
但是怎样判断遍历到第五个?谁知道告诉我,谢谢!
但是怎样判断遍历到第五个?谁知道告诉我,谢谢!
解决方案 »
- 刚学struts写了一个很小很小的例子,但在部署之后启动tomcat报错,Error deploying configuration descriptor!!!
- 登陆界面怎么有这么多问号
- Fckeditor 怎么添加导入word文档的功能???急急急。。。
- 有一个二级域名的问题请教一下!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ****能不能 图片转格式呢*****???
- 急!大家帮我看看哪不对啊? 查了好久了5555
- 怎样写一个action将已上传的文件下载下来?
- 奇怪的乱码!谁来帮帮忙?在线等!!
- 请问如何上传一个文件到Oracle数据库?
- 求助:JSP或者javascript中处理表单的一点问题
- 如何导入数据
- 如何设计属性与内容模型具有排斥性约束的Schema?
<#assign seq = ["test1", "test2", "test3", "test4", "test5","test6"]>
<#list seq as x>
${x_index + 1}. ${x}<#if x_index+1==5>----line</#if>
</#list> JAVAimport java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;import freeer.template.Configuration;
import freeer.template.DefaultObjectWrapper;
import freeer.template.Template;
import freeer.template.TemplateException;public class Test
{
/** <一句话功能简述>
* <功能详细描述>
* @param args [参数说明]
*
* @return void [返回类型说明]
* @exception throws [违例类型] [违例说明]
* @see [类、类#方法、类#成员]
*/
public static void main(String[] args)
{
Configuration cfg = new Configuration();
// Specify the data source where the template files come from.
// Here I set a file directory for it:
cfg.setClassForTemplateLoading(Test.class, "");
// Specify how templates will see the data-model. This is an advanced topic...
// but just use this:
cfg.setObjectWrapper(new DefaultObjectWrapper());
try
{
Template temp = cfg.getTemplate("test.ftl");
temp.process(null, new PrintWriter(System.out));
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (TemplateException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
运行结果:
1. test1
2. test2
3. test3
4. test4
5. test5----line
6. test6