• 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 Lig Question

 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I've decided to create a JSP tag library to encapsulate my persistence engine. This excites me, because now my Data Beans can be used anywhere -- swing, (BMP) EJBs, JSPs, etc., and go through the same set of code to persist themselves.
But Tag libs are something I'm just starting to muddle though. The on-line tutorials are OK, but somewhat incomplete as far as the more interesting thing that I want to do. I've got it working, but now I would like to improve it. Here's my code:

My question:
I want rows in my table to alternate colors. My dataLoop tag has a currentElementNumber member. How can I access that information from the JSP so that I can adjust the color of the row?
 
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
Your tag can export a scripting variable that is available inside its body. In JSP 1.2 explore the <variable> TLD tag. In JSP 1.1 you need to use the TEI mechanism.
bear
 
Joel McNary
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Bear. That just the pointer I was looking for....
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic