tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Engilis" <>
Subject Can't call the field from a specific table.
Date Mon, 13 Jan 2003 17:29:17 GMT
In a query like the one below there are various fields where the names are
the same, yet they originate from different tables:

<sql:query var="Amenities">
    SELECT rn.resort_id, oa.all_inclusive, oa.beach,,
oa.child_care, oa.cross_country_skiing,, oa.game_room,
oa.grocery_store, oa.hairdresser, oa.health_club, oa.horseback_riding,
oa.housekeeping, oa.lake, oa.laundry, oa.raquetball, oa.scuba,
oa.ski_school,, oa.whirlpool_hottub, oa.boating,,
oa.auto_rental,, oa.sauna,,, na.auto_rental,, na.scuba, na.water_skiing, na.cross_country_skiing,
na.boating, na.ski_school, na.medical_facility, na.beach,,
na.grocery_store, na.health_club, na.horseback_riding,,
na.attractions, na.kareoke, na.wind_surfing,, na.lake
 FROM resort_name rn
 LEFT JOIN nearby_amenities na ON rn.resort_id = na.resort_id
 LEFT JOIN onsite_amenities oa ON rn.resort_id = oa.resort_id
 WHERE rn.resort_id = ?
 <sql:param value="${resortID}"/>

In jsp I would normally compare the value of the field from a specific table
like so (after putting it into a resultSet and iterating over the data):

<%  variable = rs.getString("");
        if (variable.equals("T"))  { %><td><li>Golf</li></td><%
} %>

Using JSTL it seems as though I'm no longer able to specify the field from
the table I desire.  After running my query and iterating over the data in a
forEach, I seem to only be able to specify the field name and not the table
abbreviation with it.

<c:forEach items="${Amenities.rows}" var="amenitiesRow">
<c:if test="${ == 'T'}"><td><li>Golf</li></td></c:if>

When I attempt replacing "" with "" it
does not appear to recognize the data (I don't get any errors).  If anyone
knows of a way I can call the field as "" or "" (specifiying
the table the field is from) using JSTL, it would be greatly appreciated.

John Engilis

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message