Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create this html table with tags?  RSS feed

 
matias casal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Ok thank you.

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

Thanks !
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JspFaq points to a JSTL tutorial.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!