1 16 17 package org.apache.taglibs.io; 18 19 import java.io.IOException ; 20 import java.io.InputStream ; 21 import java.io.InputStreamReader ; 22 import java.io.OutputStream ; 23 import java.io.Reader ; 24 import java.io.Writer ; 25 26 import javax.servlet.ServletContext ; 27 import javax.servlet.jsp.JspException ; 28 import javax.servlet.jsp.tagext.BodyContent ; 29 import javax.servlet.jsp.tagext.Tag ; 30 31 37 public class PipeTag extends TransformerTagSupport { 38 39 public PipeTag() { 40 } 41 42 45 protected void transform( 46 Reader reader, 47 Writer writer 48 ) throws IOException , JspException { 49 Tag parent = getParent(); 50 if ( parent instanceof PipeConsumer ) { 51 PipeConsumer consumer = (PipeConsumer) parent; 52 consumer.setReader( reader ); 53 } 54 else { 55 PipeHelper.pipe( reader, writer ); 56 } 57 } 58 } 59 | Popular Tags |