1 16 package org.apache.taglibs.string; 17 18 import javax.servlet.jsp.JspException ; 19 import org.apache.commons.lang.CharSetUtils; 20 21 41 public class CountTag extends StringTagSupport { 42 43 private String set; 44 45 public CountTag() { 46 super(); 47 } 48 49 54 public String getSet() { 55 return this.set; 56 } 57 58 63 public void setSet(String set) { 64 this.set = set; 65 } 66 67 68 69 public String changeString(String text) throws JspException { 70 return ""+CharSetUtils.count(text, set); 71 } 72 73 public void initAttributes() { 74 75 this.set = null; 76 77 } 78 79 } 80 | Popular Tags |