Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

data grid in jsp

Thread view: 
savita - 29 Mar 2007 12:59 GMT
Hi All,

        I have to fetch records from database and display on jsp page
in data grid.
Record  can be displayed in tabular form in table.
How use datagrid in jsp.I have been searching for long time ,but
couldn't . It will be helpful if some could  pass on the code .

Thanks
Regards
savita
Andrew Thompson - 29 Mar 2007 13:14 GMT
..
>  How use datagrid in jsp.

Is that a statement or a question?
(Note the inclusion of '?' marks my
words as a question.)

In any case, probably much the same way
you might use a <TABLE> in <HTML>.

Andrew T.
Lew - 29 Mar 2007 13:26 GMT
> ..
>>  How use datagrid in jsp.
[quoted text clipped - 5 lines]
> In any case, probably much the same way
> you might use a <TABLE> in <HTML>.

I suggest using <table> in <html>.

The other will work but is becoming deprecated.

-- Lew
savita - 29 Mar 2007 14:33 GMT
> ..
>
[quoted text clipped - 8 lines]
>
> Andrew T.

Thanks  alot for  you suggestion.
Thanks
Regards
Savita
voorth - 29 Mar 2007 14:38 GMT
> I have to fetch records from database and display on jsp page
> in data grid.
> Record  can be displayed in tabular form in table.
>  How use datagrid in jsp.I have been searching for long time ,but
> couldn't . It will be helpful if some could  pass on the code .

The trick is using the "c:foreach" tag:
assuming you have a collection named "entries"

  <c:if test="${not empty entries}">
    <table>
      <thead>
        <tr>
          <th>Column 1</th>
          <th>Column 2</th>
        </tr>
      </thead>
      <tbody>
        <c:forEach
          var="entry"
          varStatus="status"
          items="${entries}"
          >
          <tr>
            <td>${entry.column1}</td>
            <td>${entry.column1}</td>
          </tr>
        </c:forEach>
      </tbody>
    </table>
  </c:if>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.