The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by saravanan]

Hi,

I am using standard-1.0.2. I want to pass dynamic values to the attributes of
set tag. Please see the below given code snippet to understand my requirement:

%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%<br /> request.setAttribute("name", "name"smilie;
request.setAttribute("value", "abc");
%>
<c:set var = "${requestScope.name}" value = "${requestScope.value}" scope>
="session" />
<c:out value = "${sessionScope.name}" default = "xyz" />

It seems runtime values to var and value attributes are not supported. When
will this be supported ? Or Can I achieve the same functionality by some other
way ?. Am I missing something ?? Please help !!

thanks,
saravanan
import-bot (20211) [Avatar] Offline
#2
Re: Passing EL to set tags
[Originally posted by bayern]

> I am using standard-1.0.2. I want to pass dynamic values to the attributes of
> set tag. Please see the below given code snippet to understand my
requirement:
>
> %@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> <%<br /> > request.setAttribute("name", "name"smilie;
> request.setAttribute("value", "abc"smilie;
> %>
> <c:set var = "${requestScope.name}" value = "${requestScope.value}" scope>
> ="session" />
> <c:out value = "${sessionScope.name}" default = "xyz" />
>
> It seems runtime values to var and value attributes are not supported. When
> will this be supported ? Or Can I achieve the same functionality by some other
> way ?. Am I missing something ?? Please help !!

"var" attributes cannot take expressions; this was designed to facilitate
support by authoring tools.

Instead, if you absolutely need to store values into a dynamic location, you
can set up a Map and use the alternative syntax to <c:set> --

<c:set target="${myMap}" property="${name}" value="${value}" />

Hope that helps,

Shawn