Search in sources :

Example 1 with SpelTemplateEngine

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;
}
Also used : SpelTemplateEngine(io.gravitee.gateway.el.SpelTemplateEngine) TemplateContext(io.gravitee.gateway.api.expression.TemplateContext)

Aggregations

TemplateContext (io.gravitee.gateway.api.expression.TemplateContext)1 SpelTemplateEngine (io.gravitee.gateway.el.SpelTemplateEngine)1