- 浏览: 106733 次
- 性别:
- 来自: 北京
-
文章分类
最新评论
-
masuweng:
JAVA对数字证书的常用操作 -
beming:
org.springframework.beans.facto ...
利用Ant与Proguard混淆引用的子工程项目jar包及打war包 -
beming:
不错,挺清晰的
利用Ant与Proguard混淆引用的子工程项目jar包及打war包 -
sotired:
mark,看看
ExtJs2.0学习系列 - 索引贴
<!--header.php end-->
<!--single.php-->
<!--loop-->
<!--post title-->
<!--Post Meta-->
<!--content with more link-->
Java代码
- <s:bean name= "org.apache.struts2.util.Counter" id= "counter" >
- <s:param name="first" value="1" />
- <s:param name="last" value="10" />
- <s:iterator>
- counter:<s:property value="current-1"/>
- </s:iterator>
- </s:bean>
其中first属性指定循环起始值,last指定循环终止值,其它相关属性可以查看org.apache.struts2.util.Counter类源码。在下面迭代器中输入循环的当前值,即:current-1
Counter类源码
- /*
- * $Id: Counter.java 471756 2006-11-06 15:01:43Z husted $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- package org.apache.struts2.util;
- import java.io.Serializable;
- /**
- * A bean that can be used to keep track of a counter.
- * <p/>
- * Since it is an Iterator it can be used by the iterator tag
- *
- */
- public class Counter implements java.util.Iterator, Serializable {
- private static final long serialVersionUID = 2796965884308060179L;
- boolean wrap = false;
- // Attributes —————————————————-
- long first = 1;
- long current = first;
- long interval = 1;
- long last = -1;
- public void setAdd(long addition) {
- current += addition;
- }
- public void setCurrent(long current) {
- this.current = current;
- }
- public long getCurrent() {
- return current;
- }
- public void setFirst(long first) {
- this.first = first;
- current = first;
- }
- public long getFirst() {
- return first;
- }
- public void setInterval(long interval) {
- this.interval = interval;
- }
- public long getInterval() {
- return interval;
- }
- public void setLast(long last) {
- this.last = last;
- }
- public long getLast() {
- return last;
- }
- // Public ——————————————————–
- public long getNext() {
- long next = current;
- current += interval;
- if (wrap && (current > last)) {
- current -= ((1 + last) - first);
- }
- return next;
- }
- public long getPrevious() {
- current -= interval;
- if (wrap && (current < first)) {
- current += (last - first + 1);
- }
- return current;
- }
- public void setWrap(boolean wrap) {
- this.wrap = wrap;
- }
- public boolean isWrap() {
- return wrap;
- }
- public boolean hasNext() {
- return ((last == -1) || wrap) ? true : (current <= last);
- }
- public Object next() {
- return new Long(getNext());
- }
- public void remove() {
- // Do nothing
- }
-
}
发表评论
-
分享J2EE学习的20个网站
2009-11-10 11:07 1034前人栽树,后人乘凉。 ... -
struts2标签集
2009-11-12 11:38 526A: <s:a xhref="" ... -
struts2标签使用 (#$%)/js命名空间
2009-11-13 14:49 749session中存有UserVO值对象,其中有networkL ... -
Struts2使用之值栈与OGNL-使用
2009-11-25 16:47 965Struts2使用之值栈与OGNL-使用 ... -
jQuery+struts+json
2009-12-09 12:10 795在struts中采用jquery利用json数据来动态无刷新更 ... -
提高JAVA代码质量,减少代码缺陷
2009-12-09 14:10 1008这是最新一期IBM developworks的专题,摘录了一些 ... -
JSP防止重复提交,重复刷新,后退
2010-01-06 12:24 1275一。前言 你在任何一个 ... -
用Session实现在线统计的功能(HttpSessionListener)
2010-01-18 16:52 1179如何用Session实现在线统计的功能,其实只要对Servle ... -
struts2:利用标签显示List嵌套Map
2010-02-01 17:12 1095List中存放一个Map,利用<s:iterator/& ... -
REFERER及jsp中request.getHeader() 相关详细
2010-02-23 17:42 909在三种情况下,<%=request.getHeader( ... -
Ubuntu下安装和配置Apache2
2010-03-05 10:15 966在Ubuntu中安装apache 安装 ... -
Struts2的Result Type
2010-03-07 15:46 0chain 用来处理Act<wbr> ... -
Java读写cookie
2010-04-02 09:51 726<!--<br><br> ... -
JSP容器的初始化和销毁 - ServletContext(转)
2010-04-20 10:19 1269ServletContext 被 Servlet 程序用来与 ... -
快速建立Subversion服务器
2010-05-20 16:19 678如何快速建立Subversion服务器,并且在项目中 ... -
Apache安装设置 - Ubuntu中文
2010-06-24 15:39 733Apache 安装设 ... -
Log4J使用完全手册(转)
2010-07-14 22:08 771Log4J是Apache的一个开放源代码项目(http:// ...
相关推荐
struts2.0struts2.0struts2.0struts2.0struts2.0struts2.0struts2.0struts2.0struts2.0struts2.0
jsp中struts2.0标签应用示例,介绍了部分标签的使用,里面有详细的文档说明。
04 在Struts 2.0中国际化(i18n)您的应用程序 05 转换器(Converter)——Struts 2.0中的魔术师 06 在Struts 2.0中实现表单数据校验(Validation) 07 Struts 2的基石——拦截器(Interceptor) 08 在Struts 2中实现...
打开网址:http://www.web-tag.net/all_7_3.htm 就是struts 2.0标签大全 或者下载CHM格式API struts2.0 标签大全,struts2.0 标签大全
在Struts 2.0中国际化(i18n)您的应用程序 转换器(Converter)——Struts 2.0中的魔术师 在Struts 2.0中实现表单数据校验(Validation) Struts 2的基石——拦截器(Interceptor) 在Struts 2中实现IoC 在Struts 2...
Struts2.0视频教程,struts2.0中文教程,Struts2.0视频教程,struts2.0中文教程,
sstruts2.0 struts2.0sstruts2.0 struts2.0sstruts2.0 struts2.0sstruts2.0 struts2.0sstruts2.0 struts2.0sstruts2.0 struts2.0sstruts2.0 struts2.0sstruts2.0 struts2.0sstruts2.0 struts2.0
讲解了struts2.0标签的详细使用,希望对你学习有点帮助
struts2.0的数据校验框架struts2.0的数据校验框架struts2.0的数据校验框架struts2.0的数据校验框架
JavaEE源代码 Struts2.0JavaEE源代码 Struts2.0JavaEE源代码 Struts2.0JavaEE源代码 Struts2.0JavaEE源代码 Struts2.0JavaEE源代码 Struts2.0JavaEE源代码 Struts2.0JavaEE源代码 Struts2.0JavaEE源代码 Struts2.0...
struts2.0jar包 struts2.0包 struts2.0源文件
可以方便大家使用 struts2.0 标签清单
此为Struts2.0最新Jar包,方便各位用于Struts2.0的开发.
精心收集的struts2.0标签教程详解,精心收集的struts2.0标签教程详解,精心收集的struts2.0标签教程详解。
关于struts2.0 标签的用途与用法的解释
struts 2.0 详细配置 struts 2.0 详细配置 struts 2.0 详细配置
struts2.0标签使用方便程序员编写不带java代码的页面,整合mvc架构
struts2.0标签库简介
struts2.0 标签库,让你用到标签时候不要愁,这里轻松找到!
struts2.0标签.chmstruts2.0标签.chmstruts2.0标签.chm