tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Schwartz ...@arrayone.com>
Subject Re: Substitution of a variable in a variable
Date Tue, 29 Mar 2005 12:42:47 GMT
In your SQL statement use an alias...

SELECT name_${language} As namedLanguage,
iso3166
FROM countries
ORDER BY name_${language}

In the <option> list...

<option value="<c:out value='${row.iso3166}' />">
    ${row.namedLanguage}
</option>

now your result column will always have the same, expected name.

Quoting Christoph Pilka <c.pilka@provacanza.de>:

>> Hi folks,
>>
>> anyone knows how to express the following snippet?
>>
>> <sql:query var="myQuery">
>>   SELECT name_${language}, iso3166 FROM countries ORDER BY name_${language}
>> </sql:query>
>> <c:forEach var="row" items="${myQuery.rows}">
>>   <option value="<c:out value='${row.iso3166}' />">
>>     ${row.name_${language}}
>>   </option>
>> </c:forEach>
>>
>> The expression ${row.name_${language}} is the one making trouble. How to
>> substitute a variable in a variable?
>>
>> Mni thx,
>> Chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>>
>>


David Schwartz
Array Software Inc.
http://www.arrayone.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message