JSTL or Struts: how to put in param within xml select clause

T

Tim Jowers

<%-- works --%>
<x:set var="currentConsultant"
select="$xmlEmployeesList//*[Id=41]"/><%-- selects the node with a
subnode Id=41--%>
<%-- works --%>
<c:set value="${param.consultantId}" var="cid" />
<%-- works --%>
<c:eek:ut value="--${cid}--"/>
<%-- fails... --%>
<x:set var="currentConsultant"
select="$xmlEmployeesList//*[Id=$cid]"/>
^
How do I pass in a param into the xml select? -----------------|

Thanks,
TimJOwers
 
T

Tim Jowers

<%-- works --%>
<x:set var="currentConsultant"
select="$xmlEmployeesList//*[Id=41]"/><%-- selects the node with a
subnode Id=41--%>
<%-- works --%>
<c:set value="${param.consultantId}" var="cid" />
<%-- works --%>
<c:eek:ut value="--${cid}--"/>
<%-- fails... --%>
<x:set var="currentConsultant"
select="$xmlEmployeesList//*[Id=$cid]"/>
^
How do I pass in a param into the xml select? -----------------|

Thanks,
TimJOwers

No can do. Single pass parser. Of course this could be done with a
single pass parser but that's another discussion. Also finding I
cannot substitute JSTL variabls into the "var" field of the core:set
funtion. YeeHa. Guess JSP2.0 will fix these shortcomings:

<c:forEach items="${phases.columnNames}" var="col">
<c:eek:ut value="${phase[col]}" />&nbsp;&nbsp;&nbsp;
<c:eek:ut value="${col}" /><br>
<%-- Next line is a buger. can you tell me how? --%>
<c:set var='<c:eek:ut value="${col}"/>'
value="${phase[col]}" scope="request"/>
<%-- also tried this:
<c:set var="${col}" value="${phase[col]}"
scope="request"/>

--%>
</c:forEach>

Trying to apply abstraction on a framework over-simplified to remove
complication doesn't seem real bright (But I just work here :)

TimJowers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top