• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to create this html table with tags?

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.
I am learning how to use jsp tags, but i have the following problem.

I had made a "dynamic" table with scriptlet, and i want to make the same table with tags.



qMaker is an object, that have the following methods
qMaker.getColumnsLength() (total of columns)
qMaker.getColumnName(i) (get a value from a cell)

The attribute fila is used to put different colours in the rows.

I would like if someone suggest me how to use tags for making the following table

Thanks in advance
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "with tags". Do you mean with the JSTL instead of scriptlets? If so, good deal -- that's the modern way to do things.

First step would be to eliminate passing a result set to the JSP. Rather, the code that fetches the database data should copy the resultset data to a Java collection and close the resultset as fast as possible. Then the collection can be sent along to the JSP for rendering.
 
matias casal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am talking about jstl.
But how should i iterate then the collections ?

How can i put the data from de st to the new html table cells correctly ?

Thank you for answering
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like you need to find a tutorial on JSTL and the EL.

Use <c:forEach> for iteration, and the EL for populating the cells with values.
 
matias casal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok thank you.

Can you suggest me a a good tutorial of el and jstl ?

Thanks !
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JspFaq points to a JSTL tutorial.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic