1 package org.apache.turbine.pipeline; 2 3 56 57 import java.io.IOException ; 58 59 import org.apache.turbine.RunData; 60 import org.apache.turbine.TurbineException; 61 import org.apache.turbine.ValveContext; 62 import org.apache.commons.logging.Log; 63 import org.apache.commons.logging.LogFactory; 64 65 72 public class JspRendererValve 73 extends AbstractValve 74 { 75 private static final Log log = LogFactory.getLog(JspRendererValve.class); 76 77 80 public void invoke(RunData data, ValveContext context) 81 throws IOException , TurbineException 82 { 83 try 84 { 85 String jsp = data.getTarget(); 86 render(data,jsp); 87 } 88 catch (Exception e) 89 { 90 throw new TurbineException(e); 91 } 92 93 context.invokeNext(data); 95 } 96 97 protected void render(RunData data, String jsp) 98 throws Exception 99 { 100 if (log.isDebugEnabled()) 101 { 102 log.debug("Rendering target " + jsp); 103 } 104 105 JspRenderer r = new JspRenderer(data); 106 r.render(jsp,true); 107 } 108 } 109 110 | Popular Tags |