1 16 package org.apache.taglibs.string; 17 18 import javax.servlet.jsp.JspException ; 19 import org.apache.commons.lang.StringUtils; 20 21 34 public class SplitTag extends StringTagSupport { 35 36 private String separator; 37 38 public SplitTag() { 39 super(); 40 } 41 42 47 public void setSeparator(String separator) { 48 this.separator = separator; 49 } 50 51 public String changeString(String text) throws JspException { 52 throw new JspException ( "INTERNAL ERROR: operation not supported" ); 53 } 54 55 public Object evaluateString(String text) throws JspException { 56 return StringUtils.split( text, this.separator ); 57 } 58 59 public void initAttributes() { 60 this.separator = null; 61 } 62 63 } 64 | Popular Tags |