if (param instanceof Map) {
context = new HashMapContext((Map<String, Object>)param, true);
} else if (param instanceof Context) {
context = (Context)param;
} else {
context = new ObjectContext(param, true);
}
}
return new TemplateContext(request, context);
}