use of io.gravitee.gateway.el.SpelTemplateEngine in project gravitee-gateway by gravitee-io.
the class RequestExecutionContext method getTemplateEngine.
@Override
public TemplateEngine getTemplateEngine() {
if (spelTemplateEngine == null) {
spelTemplateEngine = new SpelTemplateEngine();
TemplateContext templateContext = spelTemplateEngine.getTemplateContext();
templateContext.setVariable("request", new EvaluableRequest(request));
templateContext.setVariable("context", new EvaluableExecutionContext(this));
if (providers != null) {
providers.forEach(templateVariableProvider -> templateVariableProvider.provide(templateContext));
}
}
return spelTemplateEngine;
}
Aggregations