You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Henri Yandell <ba...@generationjava.com> on 2003/03/01 05:46:19 UTC
[jstl] sql result
Is there a better way to get an element out of a result from an
sql:query than:
<c:out value="${result.rowsByIndex[0][0]}"/>
The only examples I've come across use forEach, which is not what I want
to go near when I expect only one row back from the query.
What I'd like to use is:
<c:out value=${result.column1}"/>
but this obviously has issues with the namespace of the result object, so
how about just having a getColumns() method which returns a sorted-map
from the Result.
[By sorted-map I mean something which can be addressed as [0] or
['column1'] or result.columns.column1, though I suspect this isn't quite
in the spec. ]
Hen
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: [jstl] sql result
Posted by Henri Yandell <ba...@generationjava.com>.
Ack. Ignore this.
<c:out value="${result.rows[0]}"/>
On Fri, 28 Feb 2003, Henri Yandell wrote:
>
> Is there a better way to get an element out of a result from an
> sql:query than:
>
> <c:out value="${result.rowsByIndex[0][0]}"/>
>
> The only examples I've come across use forEach, which is not what I want
> to go near when I expect only one row back from the query.
>
> What I'd like to use is:
>
> <c:out value=${result.column1}"/>
>
> but this obviously has issues with the namespace of the result object, so
> how about just having a getColumns() method which returns a sorted-map
> from the Result.
>
> [By sorted-map I mean something which can be addressed as [0] or
> ['column1'] or result.columns.column1, though I suspect this isn't quite
> in the spec. ]
>
> Hen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org