title: create variable with dynamic name
body: <p>I have a tag that needs to have dynamically named page scoped variables.</p>
  
  <p><strong>someTag.tag</strong></p>
  
  <pre><code>&lt;%@ tag language="java" pageEncoding="UTF-8" dynamic-attributes="expressionVariables" %&gt;
  
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  
  &lt;%@ attribute name="expression" required="true" type="java.lang.String" %&gt;
  
  &lt;c:out value="${expression}" /&gt; &lt;%-- this is just an example, I use expressions differently, they are not jsp el actually --%&gt;
  </code></pre>
  
  <p>and usage example</p>
  
  <pre><code>&lt;%@ taglib prefix="custom_tags" tagdir="/WEB-INF/tags/custom_tags" %&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  
  &lt;c:set var="someAttr" value="someValue" /&gt;
  &lt;custom_tags:someTag expression="someMethod(#localAttr)" localAttr="${someAttr}" /&gt;
  </code></pre>
  
  <p>I need to put <code>localAttr</code> to tag's page scope, but jstl <code>&lt;c:set var='${....}'... /&gt;</code> does not accept dynamic names.</p>
  
  <p>I currently use following scriptlet:</p>
  
  <pre><code>&lt;c:forEach items="${expressionVariables}" var="exprVar"&gt;
      &lt;% jspContext.setAttribute(((java.util.Map.Entry)jspContext.getAttribute("exprVar")).getKey().toString(), ((java.util.Map.Entry)jspContext.getAttribute("exprVar")).getValue()); %&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Are there any other approach to do that?</p>