Save This Page
Home » struts-2.1.8.1-src » org.apache.struts2.showcase.tag.nonui » iteratortag » [javadoc | source]
    1   /*
    2    * $Id: SubsetIteratorTagDemo.java 471756 2006-11-06 15:01:43Z husted $
    3    *
    4    * Licensed to the Apache Software Foundation (ASF) under one
    5    * or more contributor license agreements.  See the NOTICE file
    6    * distributed with this work for additional information
    7    * regarding copyright ownership.  The ASF licenses this file
    8    * to you under the Apache License, Version 2.0 (the
    9    * "License"); you may not use this file except in compliance
   10    * with the License.  You may obtain a copy of the License at
   11    *
   12    *  http://www.apache.org/licenses/LICENSE-2.0
   13    *
   14    * Unless required by applicable law or agreed to in writing,
   15    * software distributed under the License is distributed on an
   16    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   17    * KIND, either express or implied.  See the License for the
   18    * specific language governing permissions and limitations
   19    * under the License.
   20    */
   21   package org.apache.struts2.showcase.tag.nonui.iteratortag;
   22   
   23   import com.opensymphony.xwork2.ActionSupport;
   24   import com.opensymphony.xwork2.Validateable;
   25   
   26   /**
   27    *
   28    */
   29   public class SubsetIteratorTagDemo extends ActionSupport implements Validateable {
   30   
   31       private static final long serialVersionUID = -8151855954644052650L;
   32   
   33       private String iteratorValue;
   34       private Integer count;
   35       private Integer start;
   36   
   37   
   38       public void validate() {
   39           if (iteratorValue == null || iteratorValue.trim().length() <= 0 ) {
   40               addFieldError("iteratorValue1", "iterator value 1 cannot be empty");
   41           }
   42           else if (iteratorValue.trim().indexOf(",") <= 0) {
   43               addFieldError("iteratorValue1", "iterator value 1 needs to be comma separated");
   44           }
   45       }
   46   
   47   
   48   
   49       public String getIteratorValue() {
   50           return this.iteratorValue;
   51       }
   52       public void setIteratorValue(String iteratorValue) {
   53           this.iteratorValue = iteratorValue;
   54       }
   55   
   56   
   57   
   58       public Integer getCount() {
   59           return this.count;
   60       }
   61       public void setCount(Integer count) {
   62           this.count = count;
   63       }
   64   
   65   
   66   
   67       public Integer getStart() {
   68           return this.start;
   69       }
   70       public void setStart(Integer start) {
   71           this.start = start;
   72       }
   73   
   74   
   75   
   76   
   77   
   78       public String input() throws Exception {
   79           return SUCCESS;
   80       }
   81   
   82       public String submit() throws Exception {
   83           return SUCCESS;
   84       }
   85   
   86   
   87   
   88   }

Save This Page
Home » struts-2.1.8.1-src » org.apache.struts2.showcase.tag.nonui » iteratortag » [javadoc | source]