• 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

Tag for HTML table

 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I just browsed through the list of JSTL tags.
I was bit surprised that I did not see any tag for dynamic HTML table creation.
This is a common requirement for many project for example displaying account transaction.
How come JSTL missed this important tag?
 
Author
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:
Hi,
I just browsed through the list of JSTL tags.
I was bit surprised that I did not see any tag for dynamic HTML table creation.
This is a common requirement for many project for example displaying account transaction.
How come JSTL missed this important tag?


JSTL is intentionally not HTML-specific. There's really no way to write a generic <table> tag that would be useful in most applications. Instead, you typically build a table up through iteration:

What more would you like? If you suggest a specific alternative, I can probably explain why JSTL didn't include it. There's little way you'd be able to construct a table as generally as with <c:forEach> using some more limited construct -- but I'd be curious to know what you're thinking anyway.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I was just wondering if it possible to display tables using a single tag..may be we will be passing the column values of the table and other things like color, size etc as attributes..
But ur code looks fine to me. I agree with U -It is difficult to build a generic tag for displaying table tag. It will no doubt be a quite complicated stuff.
Thanks for clearing my doubt.
 
Shawn Bayern
Author
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:
Hi,
I was just wondering if it possible to display tables using a single tag..may be we will be passing the column values of the table and other things like color, size etc as attributes..
But ur code looks fine to me. I agree with U -It is difficult to build a generic tag for displaying table tag. It will no doubt be a quite complicated stuff.
Thanks for clearing my doubt.


Indeed - more specifically, things like color and size are a function of the presentation tier, not the back-end. In JSP 2.0, if you find yourself using a particular pattern of JSTL tags frequently, you can write a JSP page that becomes its own new tag. (That's a little subtle, so if it seems confusing, don't worry about it for now -- it's just a feature in the future.)
 
reply
    Bookmark Topic Watch Topic
  • New Topic