• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tag Lig Question  RSS feed

 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Bear. That just the pointer I was looking for....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!