Is it possible to use a VariableResolver inside an Action?
<h2>Overview</h2>

<p>I have a properties file which as loaded on a listener and contains some EL expressions on two variables:</p>

<pre><code>foo.path=${pageContext.request.contextPath}/foo
bar.path=${application.realPath}/bar
</code></pre>

<p>I was able to load this properties and resolve the EL expressions on the JSP pages they are used, but there are one action I need to resolve those too.
I can't put those properties on the Action because the app was customized to allow those properties to be overrided by providing a properties file in a folder the system knows.</p>

<h2>What I have done so far</h2>

<p><strong>1. Evaluator class to parse the properties</strong></p>

<pre><code>public class MyExpressionEvaluator
{
  private PageContext pageContext;

  public MyExpressionEvaluator(PageContext pageContext)
  {
    this.pageContext = pageContext;
  }

  public &lt;T extends Object&gt; T evaluate(String expression, Class&lt;T&gt; clazz)
  {
    T value = null;

    ExpressionEvaluator evaluator = pageContext.getExpressionEvaluator();
    VariableResolver variableResolver = pageContext.getVariableResolver();
    try
    {
      value = clazz.cast(evaluator.evaluate(expression, clazz,
          variableResolver, null));
    }
    catch (ELException e)
    {
      log.error("Error while evaluating expression", e);
    }

    return value;
  }
}
</code></pre>

<p><strong>2. Call the functions on a jsp scriptlet:</strong></p>

<pre><code>private String buildConfigObject(Configuration conf, PageContext pageContext) {
        // Helper function which retrieves a JSON from properties
        StringBuilder configValue = parseConfig(conf);

        MyExpressionEvaluator evaluator = new MyExpressionEvaluator(pageContext);
        value = evaluator.evaluate(configValue.toString(), String.class);

        return (value != null) ? value : configValue.toString();
}

&lt;script type="text/javascript"&gt;
 var generatedContent = &lt;%= buildConfigObject(conf, pageContext)%&gt;;
&lt;/script&gt;
</code></pre>

<hr>

<p>I don't know how to proceed with the Action, since I don't have access to the pageContext on that point.</p>

<h2>Versions</h2>

<ul>
<li>JSP: 2.0</li>
<li>Servlet API: 3.0</li>
<li>JSTL: 1.2.0</li>
<li>Struts: 2.1.6</li>
</ul>