Question: If I set session like this:

```
<% 
session.setAttribute("taintedAttribute", "what ever we want");
%>

```

normally we can get session variable like this in EL

```
${sessionScope.taintedAttribute }

```

But how about if I want to do like this

```
<% 
String name = "taintedAttribute";
//session.setAttribute(name, "what ever we want");
session.getAttribute(name);
%>

```

Then how can we call it in EL?

Can EL get something like `${sessionScope.---dynamic name ---}`?

If I do this:

```
<c:set var="name" value="taintedAttribute" />
<c:out value="${sessionScope.[name]}"/>

```

the name will be replaced by `taintedAttribute` as the same as this line

```
${sessionScope.taintedAttribute}

```

Is that possible? How can I do that?

Answer: 
```html
<c:set var="name" value="taintedAttribute" />
<c:out value="${sessionScope.[name]}"/>

```

You were close. Remove the period.

```html
<c:set var="name" value="taintedAttribute" />
<c:out value="${sessionScope[name]}"/>

```

### See also:

* [Our EL wiki page](https://stackoverflow.com/tags/el/info)
* [Java EE 6 tutorial - Examples of EL expressions](http://docs.oracle.com/javaee/6/tutorial/doc/bnaim.html)
Look at <http://www.java2s.com/Code/Java/JSTL/JSTLSetVariablesScope.htm>

```
<c:set var="test" value="Session Level Value"
    scope="session" />
<c:out value="${sessionScope.test}" />

```