org.apache.turbine.services.webmacro
Class TurbineWebMacro
java.lang.Object
|
+--org.apache.turbine.services.webmacro.TurbineWebMacro
- public abstract class TurbineWebMacro
- extends java.lang.Object
This is a simple static accessor to common WebMacro tasks such as
getting an instance of a context as well as handling a request for
processing a template. It uses the TurbineWebMacroService to
obtain an instance of WebMacro.
WebContext context = WebMacro.getContext(data);
context.put("message", "Hello from Turbine!");
String results = WebMacro.handleRequest(context,"helloWorld.wm");
data.getPage().getBody().addElement(results);
- Version:
- $Id$
- Author:
- Jon S. Stevens, Daniel Rall
Method Summary |
static org.webmacro.servlet.WebContext |
getContext()
This method returns a blank WebContext object. |
static org.webmacro.servlet.WebContext |
getContext(RunData data)
This returns a WebContext that you can pass into handleRequest
once you have populated it with information that the template
will know about. |
protected static WebMacroService |
getService()
Utility method for accessing the service implementation. |
static java.lang.String |
handleRequest(org.webmacro.servlet.WebContext context,
java.lang.String templateFilePath)
|
static void |
handleRequest(org.webmacro.servlet.WebContext context,
java.lang.String filename,
java.io.OutputStream out)
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
TurbineWebMacro
public TurbineWebMacro()
getService
protected static final WebMacroService getService()
- Utility method for accessing the service implementation.
- Returns:
- A WebMacroService implementation instance.
handleRequest
public static void handleRequest(org.webmacro.servlet.WebContext context,
java.lang.String filename,
java.io.OutputStream out)
throws java.lang.Exception
- See Also:
WebMacroService.handleRequest(org.webmacro.servlet.WebContext, java.lang.String)
handleRequest
public static java.lang.String handleRequest(org.webmacro.servlet.WebContext context,
java.lang.String templateFilePath)
throws java.lang.Exception
- See Also:
WebMacroService.handleRequest(org.webmacro.servlet.WebContext, java.lang.String)
getContext
public static org.webmacro.servlet.WebContext getContext(RunData data)
- This returns a WebContext that you can pass into handleRequest
once you have populated it with information that the template
will know about.
- Parameters:
data
- A Turbine RunData.- Returns:
- A WebContext.
getContext
public static org.webmacro.servlet.WebContext getContext()
- This method returns a blank WebContext object.
- Returns:
- A WebContext.
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.