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 PrechompTag extends StringTagSupport { 35 36 private String delimiter; 37 38 public PrechompTag() { 39 super(); 40 } 41 42 47 public String getDelimiter() { 48 return this.delimiter; 49 } 50 51 56 public void setDelimiter(String delimiter) { 57 this.delimiter = delimiter; 58 } 59 60 61 62 public String changeString(String text) throws JspException { 63 return StringUtils.substringAfter(text, delimiter); 64 } 65 66 public void initAttributes() { 67 this.delimiter = "\n"; 68 } 69 70 71 } 72 | Popular Tags |