1 package org.apache.turbine.services.velocity; 2 3 18 19 import java.io.OutputStream ; 20 import java.io.Writer ; 21 22 import org.apache.turbine.services.TurbineServices; 23 import org.apache.turbine.util.RunData; 24 25 import org.apache.velocity.context.Context; 26 27 43 public abstract class TurbineVelocity 44 { 45 51 public static VelocityService getService() 52 { 53 return (VelocityService) TurbineServices 54 .getInstance().getService(VelocityService.SERVICE_NAME); 55 } 56 57 68 public static String handleRequest(Context context, String template) 69 throws Exception 70 { 71 return getService().handleRequest(context, template); 72 } 73 74 84 public static void handleRequest(Context context, String template, 85 OutputStream out) 86 throws Exception 87 { 88 getService().handleRequest(context, template, out); 89 } 90 91 101 public static void handleRequest(Context context, 102 String template, 103 Writer writer) 104 throws Exception 105 { 106 getService().handleRequest(context, template, writer); 107 } 108 109 117 public static Context getContext(RunData data) 118 { 119 return getService().getContext(data); 120 } 121 122 130 public static Context getContext() 131 { 132 return getService().getContext(); 133 } 134 135 140 public static Context getNewContext() 141 { 142 return getService().getNewContext(); 143 } 144 145 151 public static void requestFinished(Context context) 152 { 153 getService().requestFinished(context); 154 } 155 } 156 | Popular Tags |