struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dalibor Kezele" <d.kez...@ecom.hr>
Subject how to number of rows in resultset without <% ...>
Date Fri, 16 Nov 2001 12:46:32 GMT
Multiple selectbox. It has size attribute which has to be set in order to
show all rows in database.
I'm using <% ...> code to get the number of rows in resultSet since I have
to know it before I take
data and display it in <table>. Could I get this size at least without <%
..>?

       <sql:preparedStatement ...>
        <sql:query>
         SELECT * FROM MYTABLE
        </sql:query>
        <% int i = 0; %>
        <sql:resultSet id="rsAction" loop="true">
         <% i++; %>
        </sql:resultSet>
        <% String size = "" + i; %>
        <sql:query>
         SELECT * FROM MYTABLE
        </sql:query>
        <html:select property="segment" multiple="true" size="<%=size %>">
         <sql:resultSet id="rsAction" loop="true">
          <% String id = rsAction.getString(1), value =
rsAction.getString(2); %>
          <html:option value="<%=id %>"><%=value%></html:option>
         </sql:resultSet>
        </html:select>
       </sql:preparedStatement>

TIA,



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message