Search in sources :

Example 1 with EnvironmentAccessor

use of org.springframework.context.expression.EnvironmentAccessor in project cas by apereo.

the class AbstractCasWebflowConfigurer method getSpringExpressionParser.

/**
     * Gets spring expression parser.
     *
     * @return the spring expression parser
     */
protected SpringELExpressionParser getSpringExpressionParser() {
    final SpelParserConfiguration configuration = new SpelParserConfiguration();
    final SpelExpressionParser spelExpressionParser = new SpelExpressionParser(configuration);
    final SpringELExpressionParser parser = new SpringELExpressionParser(spelExpressionParser, this.flowBuilderServices.getConversionService());
    parser.addPropertyAccessor(new ActionPropertyAccessor());
    parser.addPropertyAccessor(new BeanFactoryPropertyAccessor());
    parser.addPropertyAccessor(new FlowVariablePropertyAccessor());
    parser.addPropertyAccessor(new MapAdaptablePropertyAccessor());
    parser.addPropertyAccessor(new MessageSourcePropertyAccessor());
    parser.addPropertyAccessor(new ScopeSearchingPropertyAccessor());
    parser.addPropertyAccessor(new BeanExpressionContextAccessor());
    parser.addPropertyAccessor(new MapAccessor());
    parser.addPropertyAccessor(new MapAdaptablePropertyAccessor());
    parser.addPropertyAccessor(new EnvironmentAccessor());
    parser.addPropertyAccessor(new ReflectivePropertyAccessor());
    return parser;
}
Also used : ActionPropertyAccessor(org.springframework.webflow.expression.spel.ActionPropertyAccessor) MessageSourcePropertyAccessor(org.springframework.webflow.expression.spel.MessageSourcePropertyAccessor) BeanFactoryPropertyAccessor(org.springframework.webflow.expression.spel.BeanFactoryPropertyAccessor) ScopeSearchingPropertyAccessor(org.springframework.webflow.expression.spel.ScopeSearchingPropertyAccessor) FlowVariablePropertyAccessor(org.springframework.webflow.expression.spel.FlowVariablePropertyAccessor) SpringELExpressionParser(org.springframework.binding.expression.spel.SpringELExpressionParser) ReflectivePropertyAccessor(org.springframework.expression.spel.support.ReflectivePropertyAccessor) BeanExpressionContextAccessor(org.springframework.context.expression.BeanExpressionContextAccessor) SpelExpressionParser(org.springframework.expression.spel.standard.SpelExpressionParser) MapAccessor(org.springframework.context.expression.MapAccessor) EnvironmentAccessor(org.springframework.context.expression.EnvironmentAccessor) MapAdaptablePropertyAccessor(org.springframework.webflow.expression.spel.MapAdaptablePropertyAccessor) SpelParserConfiguration(org.springframework.expression.spel.SpelParserConfiguration)

Example 2 with EnvironmentAccessor

use of org.springframework.context.expression.EnvironmentAccessor in project spring-framework by spring-projects.

the class EvalTag method createEvaluationContext.

private EvaluationContext createEvaluationContext(PageContext pageContext) {
    StandardEvaluationContext context = new StandardEvaluationContext();
    context.addPropertyAccessor(new JspPropertyAccessor(pageContext));
    context.addPropertyAccessor(new MapAccessor());
    context.addPropertyAccessor(new EnvironmentAccessor());
    context.setBeanResolver(new BeanFactoryResolver(getRequestContext().getWebApplicationContext()));
    ConversionService conversionService = getConversionService(pageContext);
    if (conversionService != null) {
        context.setTypeConverter(new StandardTypeConverter(conversionService));
    }
    return context;
}
Also used : StandardTypeConverter(org.springframework.expression.spel.support.StandardTypeConverter) BeanFactoryResolver(org.springframework.context.expression.BeanFactoryResolver) StandardEvaluationContext(org.springframework.expression.spel.support.StandardEvaluationContext) ConversionService(org.springframework.core.convert.ConversionService) MapAccessor(org.springframework.context.expression.MapAccessor) EnvironmentAccessor(org.springframework.context.expression.EnvironmentAccessor)

Aggregations

EnvironmentAccessor (org.springframework.context.expression.EnvironmentAccessor)2 MapAccessor (org.springframework.context.expression.MapAccessor)2 SpringELExpressionParser (org.springframework.binding.expression.spel.SpringELExpressionParser)1 BeanExpressionContextAccessor (org.springframework.context.expression.BeanExpressionContextAccessor)1 BeanFactoryResolver (org.springframework.context.expression.BeanFactoryResolver)1 ConversionService (org.springframework.core.convert.ConversionService)1 SpelParserConfiguration (org.springframework.expression.spel.SpelParserConfiguration)1 SpelExpressionParser (org.springframework.expression.spel.standard.SpelExpressionParser)1 ReflectivePropertyAccessor (org.springframework.expression.spel.support.ReflectivePropertyAccessor)1 StandardEvaluationContext (org.springframework.expression.spel.support.StandardEvaluationContext)1 StandardTypeConverter (org.springframework.expression.spel.support.StandardTypeConverter)1 ActionPropertyAccessor (org.springframework.webflow.expression.spel.ActionPropertyAccessor)1 BeanFactoryPropertyAccessor (org.springframework.webflow.expression.spel.BeanFactoryPropertyAccessor)1 FlowVariablePropertyAccessor (org.springframework.webflow.expression.spel.FlowVariablePropertyAccessor)1 MapAdaptablePropertyAccessor (org.springframework.webflow.expression.spel.MapAdaptablePropertyAccessor)1 MessageSourcePropertyAccessor (org.springframework.webflow.expression.spel.MessageSourcePropertyAccessor)1 ScopeSearchingPropertyAccessor (org.springframework.webflow.expression.spel.ScopeSearchingPropertyAccessor)1