public String getContent(RunData data, String name, String value, Map parms)
{
String result = null;
// Get reference to jsp service
JspService jspService = (JspService) TurbineServices.getInstance().getService(JspService.SERVICE_NAME);
// Put basics in the context
data.getRequest().setAttribute("data", data);
data.getRequest().setAttribute("name", name);
data.getRequest().setAttribute("value", value);
data.getRequest().setAttribute("parms", parms);
data.getRequest().setAttribute("events", this.getJavascriptEvents());
try
{
// Put all style parameters in the context
for (Iterator it = parms.keySet().iterator(); it.hasNext();)
{
String key = (String) it.next();
data.getRequest().setAttribute(key, parms.get(key));
}
// Add custom objects to the context
this.buildContext(data, name, value, parms);
// Build default template name (classname + .vm)
String className = this.getClass().getName();
int pos = className.lastIndexOf(".");
pos = pos < 0 ? 0 : pos + 1;
className = className.substring(pos);
// Render the template
String template = (String) this.getParm("template", className + ".jsp");
String templatePath = TemplateLocator.locateParameterTemplate(data, template);
jspService.handleRequest(data, templatePath);
result = "";
}
catch (Exception e)
{
logger.error("Exception", e);